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

Unified Diff: tools/telemetry/telemetry/util/statistics.py

Issue 643343002: Telemetry: Add mean-frame-time and tasks-per-frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « tools/perf/metrics/timeline_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/util/statistics.py
diff --git a/tools/telemetry/telemetry/util/statistics.py b/tools/telemetry/telemetry/util/statistics.py
index 5308b5145d126e048798d33aac25b3b337b028b6..9867f45d27bdeca7611f46739248b3f1d129c787 100644
--- a/tools/telemetry/telemetry/util/statistics.py
+++ b/tools/telemetry/telemetry/util/statistics.py
@@ -262,10 +262,7 @@ def Total(data):
def DivideIfPossibleOrZero(numerator, denominator):
"""Returns the quotient, or zero if the denominator is zero."""
- if not denominator:
- return 0.0
- else:
- return numerator / denominator
+ return (float(numerator) / float(denominator)) if denominator else 0
def GeneralizedMean(values, exponent):
« no previous file with comments | « tools/perf/metrics/timeline_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698