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

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

Issue 22754003: Refactor BenchmarkResult.Add to take enum for data_type (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 3 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/media.py ('k') | tools/perf/metrics/smoothness.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/memory.py
===================================================================
--- tools/perf/metrics/memory.py (revision 222891)
+++ tools/perf/metrics/memory.py (working copy)
@@ -6,7 +6,12 @@
from metrics import histogram_util
from metrics import Metric
+from telemetry.core import util
+# Get build scripts into our path.
+util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'util', 'lib')
+from common import perf_result_data_type # pylint: disable=F0401
+
_HISTOGRAMS = [
{'name': 'V8.MemoryExternalFragmentationTotal', 'units': 'percent',
'type': histogram_util.RENDERER_HISTOGRAM},
@@ -85,7 +90,7 @@
if h['name'] not in self._histogram_start:
continue
results.Add(h['name'], h['units'], self._histogram_delta[h['name']],
- data_type='unimportant-histogram')
+ data_type=perf_result_data_type.UNIMPORTANT_HISTOGRAM)
def AddSummaryResults(self, results):
"""Add summary (overall) results to the results object."""
@@ -119,8 +124,10 @@
if value_name_memory in stats:
values.append(stats[value_name_memory])
if values:
- results.AddSummary(value_name_trace + process_type_trace,
- 'bytes', sum(values), data_type='unimportant')
+ (results
+ .AddSummary(value_name_trace + process_type_trace,
+ 'bytes', sum(values),
+ data_type=perf_result_data_type.UNIMPORTANT_HISTOGRAM) )
AddSummary('VM', 'vm_final_size_')
AddSummary('WorkingSetSize', 'vm_%s_final_size_' % metric)
@@ -137,7 +144,7 @@
end_commit_charge = self._memory_stats['SystemCommitCharge']
commit_charge_difference = end_commit_charge - self._start_commit_charge
results.AddSummary('commit_charge', 'kb', commit_charge_difference,
- data_type='unimportant')
+ data_type=perf_result_data_type.UNIMPORTANT)
results.AddSummary('processes', 'count', self._memory_stats['ProcessCount'],
- data_type='unimportant')
+ data_type=perf_result_data_type.UNIMPORTANT)
« no previous file with comments | « tools/perf/metrics/media.py ('k') | tools/perf/metrics/smoothness.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698