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

Unified Diff: tools/perf/metrics/webrtc_stats.py

Issue 2561603003: Add encoding time and and fps to webrtc.stress case. (Closed)
Patch Set: Don't log more than 5 conns Created 4 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
« no previous file with comments | « tools/perf/measurements/webrtc.py ('k') | tools/perf/metrics/webrtc_stats_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/webrtc_stats.py
diff --git a/tools/perf/metrics/webrtc_stats.py b/tools/perf/metrics/webrtc_stats.py
index 60424c6da4242c0361794e1f8c9dfea73500ee49..8c3570316cbcc6e71f944cd2157df051c5baf313 100644
--- a/tools/perf/metrics/webrtc_stats.py
+++ b/tools/perf/metrics/webrtc_stats.py
@@ -70,6 +70,16 @@ INTERESTING_METRICS = {
}
+def SelectMetrics(particular_metrics):
+ if not particular_metrics:
+ return INTERESTING_METRICS
+
+ # You can only select among the predefined interesting metrics.
+ assert set(particular_metrics).issubset(INTERESTING_METRICS.keys())
+ return {key: value for key, value in INTERESTING_METRICS.iteritems()
+ if key in particular_metrics}
+
+
def GetReportKind(report):
if 'audioInputLevel' in report or 'audioOutputLevel' in report:
return 'audio'
@@ -94,12 +104,12 @@ def StripAudioVideoBweDistinction(stat_name):
return re.sub('^(audio|video|bwe)_', '', stat_name)
-def SortStatsIntoTimeSeries(report_batches):
+def SortStatsIntoTimeSeries(report_batches, selected_metrics):
time_series = {}
for report_batch in report_batches:
for report in report_batch:
for stat_name, value in report.iteritems():
- if stat_name not in INTERESTING_METRICS:
+ if stat_name not in selected_metrics:
continue
if GetReportKind(report) == 'unknown':
continue
@@ -109,12 +119,21 @@ def SortStatsIntoTimeSeries(report_batches):
return time_series
+def PrintSpecialMarkerValue(results):
+ results.AddValue(list_of_scalar_values.ListOfScalarValues(
+ results.current_page, 'peer_connection_5_not_logging_more_conns',
+ '', [17], description=('This marker signifies we never log more '
+ 'than 5 peer connections'),
+ important=False))
+
+
class WebRtcStatisticsMetric(Metric):
"""Makes it possible to measure stats from peer connections."""
- def __init__(self):
+ def __init__(self, particular_metrics=None):
super(WebRtcStatisticsMetric, self).__init__()
self._all_reports = None
+ self._selected_metrics = SelectMetrics(particular_metrics)
def Start(self, page, tab):
pass
@@ -130,7 +149,13 @@ class WebRtcStatisticsMetric(Metric):
reports = json.loads(self._all_reports)
for i, report in enumerate(reports):
- time_series = SortStatsIntoTimeSeries(report)
+ time_series = SortStatsIntoTimeSeries(report, self._selected_metrics)
+
+ # Only ever show stats for 5 peer connections, or it's going to look
+ # insane in the results.
+ if i > 5:
+ PrintSpecialMarkerValue(results)
+ return
for stat_name, values in time_series.iteritems():
stat_name_underscored = camel_case.ToUnderscore(stat_name)
« no previous file with comments | « tools/perf/measurements/webrtc.py ('k') | tools/perf/metrics/webrtc_stats_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698