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

Unified Diff: infra_libs/ts_mon/common/metric_store.py

Issue 1531573003: Handle multiple modifications to distribution metrics correctly. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years 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
Index: infra_libs/ts_mon/common/metric_store.py
diff --git a/infra_libs/ts_mon/common/metric_store.py b/infra_libs/ts_mon/common/metric_store.py
index c40333f7ae519ca58ca5c08425b60ae07fb1c776..5bb6c30681c1637394f55809b2ac168d3913dd88 100644
--- a/infra_libs/ts_mon/common/metric_store.py
+++ b/infra_libs/ts_mon/common/metric_store.py
@@ -24,26 +24,6 @@ Modification = collections.namedtuple(
'Modification', ['name', 'fields', 'mod_type', 'args'])
-def combine_modifications(old, new):
- """Combines two modifications into one.
-
- The returned modification will be the result as if the second modification had
- been applied after the first.
- """
-
- if old is None or new.mod_type == 'set':
- # A 'set' will override any previous value.
- return new
- elif new.mod_type == 'incr':
- # For two 'incr's sum their delta args, for an 'incr' on top of a 'set' add
- # the delta to the set value.
- return Modification(
- old.name, old.fields, old.mod_type,
- (old.args[0] + new.args[0], old.args[1]))
- else:
- raise errors.UnknownModificationTypeError(new.mod_type)
-
-
class MetricStore(object):
"""A place to store values for each metric.

Powered by Google App Engine
This is Rietveld 408576698