Add a new logo for the autotest web interface
[autotest-zwu.git] / client / profilers / mpstat / mpstat.py
blob74fc43fa58b84ee40501161fcbeeae543d13aada
1 """
2 Sets up a subprocess to run mpstat on a specified interval, default 1 second
3 """
4 import time, os, subprocess
5 from autotest_lib.client.bin import profiler
8 class mpstat(profiler.profiler):
9 version = 1
12 def initialize(self, interval = 1):
13 self.interval = interval
16 def start(self, test):
17 cmd = "mpstat -P ALL %d" % self.interval
18 logfile = open(os.path.join(test.profdir, "mpstat"), 'w')
19 p = subprocess.Popen(cmd, shell=True, stdout=logfile,
20 stderr=subprocess.STDOUT)
21 self.pid = p.pid
24 def stop(self, test):
25 os.kill(self.pid, 15)
28 def report(self, test):
29 return None