blob: 194086f160320ed12f546819de8f7f0801eeb6c7 [file] [log] [blame]
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from autotest_lib.server import test
from autotest_lib.server.cros import telemetry_runner
class telemetry_Benchmarks(test.test):
"""Run a telemetry benchmark."""
version = 1
def run_once(self, host=None, benchmark=None, args={}):
"""Run a telemetry benchmark.
@param host: hostname(ip address) to run the telemetry benchmark on.
@param benchmark: telemetry benchmark test to run.
local = args.get("local") == "True"
optional = {}
telemetry_on_dut = args.get("telemetry_on_dut")
if telemetry_on_dut:
optional["telemetry_on_dut"] = telemetry_on_dut == "True"
telemetry = telemetry_runner.TelemetryRunner(host, local, **optional)
perf_value_writer = self
extra_args = args.get("extra_args", [])
repeat = args.get("pageset_repeat")
if repeat is not None:
extra_args.append('--pageset-repeat=%s' % repeat)
telemetry.run_telemetry_benchmark(benchmark, perf_value_writer,