blob: d624e498ab57b309287a3301ea01b85918e80c6e [file] [log] [blame]
# Copyright 2018 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.
import time
from autotest_lib.client.cros.power import power_dashboard
from autotest_lib.client.cros.power import power_test
class power_Dummy(power_test.power_Test):
"""class for testing power wrapper tests.
Run for a short time and collect logger data.
version = 1
loop = 3
loop_time = 3.0
dummy_result = 0
def initialize(self, pdash_note='', force_discharge=False):
"""Measure power with a short interval."""
super(power_Dummy, self).initialize(seconds_period=1.,
def warmup(self):
"""Warm up for a short time."""
super(power_Dummy, self).warmup(warmup_time=1.)
def run_once(self):
"""Measure power with multiple loggers."""
start_ts = time.time()
for i in range(self.loop):
tstart = time.time()
self.checkpoint_measurements('section%s' % i, tstart)
logger = power_dashboard.KeyvalLogger(start_ts, time.time())
logger.add_item('system', self.dummy_result, 'watt', 'power')