Skip to content

Instantly share code, notes, and snippets.

@clarkbw
Created March 9, 2016 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clarkbw/2d62cb367bd51cd7ff0c to your computer and use it in GitHub Desktop.
Save clarkbw/2d62cb367bd51cd7ff0c to your computer and use it in GitHub Desktop.
gathers the DEVTOOLS Telemetry Histograms
import json
from functools import cmp_to_key
import locale
import urllib2
local_fname = 'Histograms.json'
url = 'https://hg.mozilla.org/mozilla-central/raw-file/tip/toolkit/components/telemetry/Histograms.json'
req = urllib2.Request(url)
response = urllib2.urlopen(req)
f = open(local_fname, 'w')
f.write(response.read())
f.close()
with open(local_fname) as data_file:
data = json.load(data_file)
keys = sorted([item for item in data], key=cmp_to_key(locale.strcoll))
for item in keys:
if item.startswith('DEVTOOLS'):
print item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment