author | Ryan VanderMeulen <ryanvm@gmail.com> |
Thu, 15 Nov 2012 21:07:38 -0500 | |
changeset 113462 | a0cd4bcb321795f59a9c05a934b6aa02cd9918b3 |
parent 113461 | a1683ba4319d76ba84ba4aead8052f074bf8305b |
child 113463 | 514bf72036719a760c1b355d91f4a18ea1a01d6e |
push id | 23872 |
push user | emorley@mozilla.com |
push date | Fri, 16 Nov 2012 17:06:27 +0000 |
treeherder | mozilla-central@a7ed19f7d21a [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 800557 |
milestone | 19.0a1 |
backs out | cc2469a8b41ad3d3472f3cd691e25c4d9f50558b |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/toolkit/components/telemetry/histogram_tools.py +++ b/toolkit/components/telemetry/histogram_tools.py @@ -1,20 +1,16 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import with_statement import math -import json -try: - from collections import OrderedDict -except ImportError: - from simplejson import OrderedDict +import simplejson as json def table_dispatch(kind, table, body): """Call body with table[kind] if it exists. Raise an error otherwise.""" if kind in table: return body(table[kind]) else: raise BaseException, "don't know how to handle a histogram of kind %s" % kind @@ -197,11 +193,11 @@ associated with the histogram. Returns definition['high'], definition['n_buckets']) def from_file(filename): """Return an iterator that provides a sequence of Histograms for the histograms defined in filename. """ with open(filename, 'r') as f: - histograms = json.load(f, object_pairs_hook=OrderedDict) + histograms = json.load(f, object_pairs_hook=json.OrderedDict) for (name, definition) in histograms.iteritems(): yield Histogram(name, definition)