Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Unified Diff: tracing/tracing/value/histogram.py

Issue 2998043002: Remove RelatedHistogramSet. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/value/histogram.html ('k') | tracing/tracing/value/histogram_set.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/value/histogram.py
diff --git a/tracing/tracing/value/histogram.py b/tracing/tracing/value/histogram.py
index 7b8f5eef66109c65db18fc9d0a990de376b21140..dd5d0cac52be8c9d16aa0aec3021295a8bad1c07 100644
--- a/tracing/tracing/value/histogram.py
+++ b/tracing/tracing/value/histogram.py
@@ -496,50 +496,6 @@ class HistogramRef(object):
return self._guid
-class RelatedHistogramSet(diagnostic.Diagnostic):
-
- def __init__(self, histograms=()):
- super(RelatedHistogramSet, self).__init__()
- self._histograms_by_guid = {}
- for hist in histograms:
- self.Add(hist)
-
- def Add(self, hist):
- assert isinstance(hist, (Histogram, HistogramRef))
- assert not self.Has(hist)
- self._histograms_by_guid[hist.guid] = hist
-
- def Has(self, hist):
- return hist.guid in self._histograms_by_guid
-
- def __len__(self):
- return len(self._histograms_by_guid)
-
- def __iter__(self):
- for hist in self._histograms_by_guid.itervalues():
- yield hist
-
- def Resolve(self, histograms, required=False):
- for hist in self:
- if isinstance(hist, Histogram):
- continue
- guid = hist.guid
- hist = histograms.LookupHistogram(guid)
- if isinstance(hist, Histogram):
- self._histograms_by_guid[guid] = hist
- else:
- assert not required, guid
-
- def _AsDictInto(self, d):
- d['guids'] = []
- for hist in self:
- d['guids'].append(hist.guid)
-
- @staticmethod
- def FromDict(d):
- return RelatedHistogramSet(HistogramRef(guid) for guid in d['guids'])
-
-
class RelatedHistogramMap(diagnostic.Diagnostic):
def __init__(self):
@@ -954,9 +910,9 @@ class DiagnosticMap(dict):
def Merge(self, other, parent_hist, other_parent_hist):
merged_from = self.get(reserved_infos.MERGED_FROM.name)
if merged_from is None:
- merged_from = RelatedHistogramSet()
+ merged_from = RelatedHistogramMap()
self[reserved_infos.MERGED_FROM.name] = merged_from
- merged_from.Add(other_parent_hist)
+ merged_from.Set(len(merged_from), other_parent_hist)
for name, other_diagnostic in other.iteritems():
if name not in self:
@@ -1584,7 +1540,6 @@ DEFAULT_BOUNDARIES_FOR_UNIT = {
all_diagnostics.DIAGNOSTICS_BY_NAME.update({
'Breakdown': Breakdown,
'GenericSet': GenericSet,
- 'RelatedHistogramSet': RelatedHistogramSet,
'UnmergeableDiagnosticSet': UnmergeableDiagnosticSet,
'RelatedEventSet': RelatedEventSet,
'BuildbotInfo': BuildbotInfo,
« no previous file with comments | « tracing/tracing/value/histogram.html ('k') | tracing/tracing/value/histogram_set.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698