| Index: tools/perf/metrics/memory.py
|
| diff --git a/tools/perf/metrics/memory.py b/tools/perf/metrics/memory.py
|
| index 70b2ccff928fe81306e7339efcddc720ade139c2..4f026bf3967f44771b647a383cefb66f9b0eb3f0 100644
|
| --- a/tools/perf/metrics/memory.py
|
| +++ b/tools/perf/metrics/memory.py
|
| @@ -7,6 +7,7 @@ import sys
|
| from metrics import Metric
|
| from telemetry.value import histogram
|
| from telemetry.value import histogram_util
|
| +from telemetry.value import improvement_direction
|
| from telemetry.value import scalar
|
|
|
|
|
| @@ -17,13 +18,15 @@ _HISTOGRAMS = [
|
| 'type': histogram_util.RENDERER_HISTOGRAM,
|
| 'description': 'Total external memory fragmentation after each GC in '
|
| 'percent.',
|
| + 'improvement_direction': improvement_direction.DOWN,
|
| },
|
| {
|
| 'name': 'V8.MemoryHeapSampleTotalCommitted', 'units': 'kb',
|
| 'display_name': 'V8_MemoryHeapSampleTotalCommitted',
|
| 'type': histogram_util.RENDERER_HISTOGRAM,
|
| 'description': 'The total size of committed memory used by V8 after '
|
| - 'each GC in KB.'
|
| + 'each GC in KB.',
|
| + 'improvement_direction': improvement_direction.DOWN,
|
| },
|
| {
|
| 'name': 'V8.MemoryHeapSampleTotalUsed', 'units': 'kb',
|
| @@ -31,21 +34,25 @@ _HISTOGRAMS = [
|
| 'type': histogram_util.RENDERER_HISTOGRAM,
|
| 'description': 'The total size of live memory used by V8 after each '
|
| 'GC in KB.',
|
| + 'improvement_direction': improvement_direction.DOWN,
|
| },
|
| {
|
| 'name': 'V8.MemoryHeapSampleMaximumCommitted', 'units': 'kb',
|
| 'display_name': 'V8_MemoryHeapSampleMaximumCommitted',
|
| - 'type': histogram_util.RENDERER_HISTOGRAM
|
| + 'type': histogram_util.RENDERER_HISTOGRAM,
|
| + 'improvement_direction': improvement_direction.DOWN,
|
| },
|
| {
|
| 'name': 'Memory.RendererUsed', 'units': 'kb',
|
| 'display_name': 'Memory_RendererUsed',
|
| - 'type': histogram_util.RENDERER_HISTOGRAM
|
| + 'type': histogram_util.RENDERER_HISTOGRAM,
|
| + 'improvement_direction': improvement_direction.DOWN,
|
| },
|
| {
|
| 'name': 'Memory.BrowserUsed', 'units': 'kb',
|
| 'display_name': 'Memory_BrowserUsed',
|
| - 'type': histogram_util.BROWSER_HISTOGRAM
|
| + 'type': histogram_util.BROWSER_HISTOGRAM,
|
| + 'improvement_direction': improvement_direction.DOWN,
|
| },
|
| ]
|
|
|
| @@ -121,7 +128,8 @@ class MemoryMetric(Metric):
|
| results.AddValue(histogram.HistogramValue(
|
| results.current_page, h['display_name'], h['units'],
|
| raw_value_json=self._histogram_delta[h['name']], important=False,
|
| - description=h.get('description')))
|
| + description=h.get('description'),
|
| + improvement_direction=h['improvement_direction']))
|
| self._memory_stats = self._browser.memory_stats
|
| if not self._memory_stats['Browser']:
|
| return
|
| @@ -135,11 +143,13 @@ class MemoryMetric(Metric):
|
| results.current_page,
|
| 'commit_charge.' + (trace_name or 'commit_charge'),
|
| 'kb', commit_charge_difference, important=False,
|
| - description='System commit charge (committed memory pages).'))
|
| + description='System commit charge (committed memory pages).',
|
| + improvement_direction=improvement_direction.DOWN))
|
| results.AddValue(scalar.ScalarValue(
|
| results.current_page, 'processes.' + (trace_name or 'processes'),
|
| 'count', self._memory_stats['ProcessCount'], important=False,
|
| - description='Number of processes used by Chrome.'))
|
| + description='Number of processes used by Chrome.',
|
| + improvement_direction=improvement_direction.DOWN))
|
|
|
|
|
| def AddResultsForProcesses(results, memory_stats, chart_trace_name='final',
|
| @@ -193,7 +203,8 @@ def AddResultsForProcesses(results, memory_stats, chart_trace_name='final',
|
| chart_name = current_trace
|
| results.AddValue(scalar.ScalarValue(
|
| results.current_page, '%s.%s' % (chart_name, current_trace), 'kb',
|
| - sum(values) / 1024, important=False, description=description))
|
| + sum(values) / 1024, important=False, description=description,
|
| + improvement_direction=improvement_direction.DOWN))
|
|
|
| AddResult('VM', 'vm_%s_size' % chart_trace_name,
|
| 'Virtual Memory Size (address space allocated).')
|
|
|