Created
March 9, 2016 00:54
-
-
Save clarkbw/2d62cb367bd51cd7ff0c to your computer and use it in GitHub Desktop.
gathers the DEVTOOLS Telemetry Histograms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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