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

Side by Side Diff: tools/perf/metrics/system_memory.py

Issue 1029263003: [telemetry] Sort imports in Telemetry and its dependents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure we're up to date. Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « tools/perf/metrics/startup_metric.py ('k') | tools/perf/metrics/timeline.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from telemetry.value import scalar
6
5 from metrics import memory 7 from metrics import memory
6 from metrics import Metric 8 from metrics import Metric
7 from telemetry.value import scalar
8 9
9 10
10 class SystemMemoryMetric(Metric): 11 class SystemMemoryMetric(Metric):
11 """SystemMemoryMetric gathers system memory statistic. 12 """SystemMemoryMetric gathers system memory statistic.
12 13
13 This metric collects system memory stats per test. It reports the difference 14 This metric collects system memory stats per test. It reports the difference
14 (delta) in system memory starts from the start of the test to the end of it. 15 (delta) in system memory starts from the start of the test to the end of it.
15 """ 16 """
16 17
17 def __init__(self, browser): 18 def __init__(self, browser):
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 memory_stats[process_type] = end_process_memory - start_value 116 memory_stats[process_type] = end_process_memory - start_value
116 else: 117 else:
117 for metric in end_process_memory: 118 for metric in end_process_memory:
118 end_value = end_process_memory[metric] 119 end_value = end_process_memory[metric]
119 start_value = start_memory_stats[process_type][metric] or 0 120 start_value = start_memory_stats[process_type][metric] or 0
120 if 'Peak' in metric: 121 if 'Peak' in metric:
121 memory_stats[process_type][metric] = end_value 122 memory_stats[process_type][metric] = end_value
122 else: 123 else:
123 memory_stats[process_type][metric] = end_value - start_value 124 memory_stats[process_type][metric] = end_value - start_value
124 return memory_stats 125 return memory_stats
OLDNEW
« no previous file with comments | « tools/perf/metrics/startup_metric.py ('k') | tools/perf/metrics/timeline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698