1# Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import logging, time 6from autotest_lib.client.bin import test 7from autotest_lib.client.cros import power_status 8 9 10class power_StatsCPUIdle(test.test): 11 version = 1 12 13 14 def run_once(self, test_time=60): 15 cpuidle_stats = power_status.CPUIdleStats() 16 17 # sleep for some time to allow the system to go into idle state 18 time.sleep(test_time) 19 20 # get updated CPU idle stats 21 current_stats = cpuidle_stats.refresh() 22 logging.info('CPUIdle stats in the last %d seconds :\n %s', 23 test_time, current_stats) 24 25