# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import sys
+
from metrics import Metric
from telemetry.value import scalar
+
class IOMetric(Metric):
"""IO-related metrics, obtained via telemetry.core.Browser."""
@classmethod
def CustomizeBrowserOptions(cls, options):
- options.AppendExtraBrowserArgs('--no-sandbox')
+ # TODO(tonyg): This is the host platform, so not totally correct.
+ if sys.platform not in ('darwin', 'win32'):
+ # TODO(playmobil): Get rid of this on all platforms crbug.com/361049.
+ options.AppendExtraBrowserArgs('--no-sandbox')
def Start(self, page, tab):
raise NotImplementedError()
process_type_trace: String to be added to the trace name in the results.
"""
- def AddSummaryForOperation(operation_name, trace_name_prefix, units):
+ def AddSummaryForOperation(operation_name, trace_name_prefix, units,
+ description):
"""Adds summary results for an operation in a process.
Args:
value = value / 1024
results.AddSummaryValue(
scalar.ScalarValue(None, trace_name_prefix + process_type_trace,
- units, value, important=False))
+ units, value, important=False,
+ description=description))
- AddSummaryForOperation('ReadOperationCount', 'read_operations_', 'count')
+ AddSummaryForOperation('ReadOperationCount', 'read_operations_', 'count',
+ 'Number of IO read operations.')
AddSummaryForOperation('WriteOperationCount', 'write_operations_',
- 'count')
- AddSummaryForOperation('ReadTransferCount', 'read_bytes_', 'kb')
- AddSummaryForOperation('WriteTransferCount', 'write_bytes_', 'kb')
+ 'count', 'Number of IO write operations.')
+ AddSummaryForOperation('ReadTransferCount', 'read_bytes_', 'kb',
+ 'Number of IO bytes read.')
+ AddSummaryForOperation('WriteTransferCount', 'write_bytes_', 'kb',
+ 'Number of IO bytes written.')
AddSummariesForProcessType('Browser', 'browser')
AddSummariesForProcessType('Renderer', 'renderer')