Пример #1
0
    def run(self, arglist=[]):
        TCTimeVMStarts.run(self, arglist)
        # Give the VMs time to settle for a bit.  (In accordance with
        # the definition of the metric.)
        xenrt.TEC().logverbose("Leaving the VMs to settle for %d seconds..." % self.settlingTime)
        time.sleep(self.settlingTime)
        TCCPUload.run(self, arglist)

        params = libperf.createLogName ("tc_cpuload_parameters")
        log = """#numdesktops
%s
""" % self.numdesktops
        libperf.outputToResultsFile(params, log, addNewline=False)
Пример #2
0
    def run(self, arglist=[]):
        TCTimeVMStarts.run(self, arglist)
        # Give the VMs time to settle for a bit.  (In accordance with
        # the definition of the metric.)
        xenrt.TEC().logverbose("Leaving the VMs to settle for %d seconds..." %
                               self.settlingTime)
        time.sleep(self.settlingTime)
        TCCPUload.run(self, arglist)

        params = libperf.createLogName("tc_cpuload_parameters")
        log = """#numdesktops
%s
""" % self.numdesktops
        libperf.outputToResultsFile(params, log, addNewline=False)
Пример #3
0
    def run(self, arglist=[]):
        # ask atop for first sample.
        #        self.signaller_pid = self._run0bg ("%s %s" % ('signaller',
        #                                                      self.atop_pid))

        self.signaller_pid = self.remoteRun(self.master,
                                            scripts['signaller'],
                                            self.atop_pid,
                                            background=True)

        self.xentop_pid = self._run0bg("xentop --batch --delay 1",
                                       self.xentopLogFile)

        time.sleep(self.seconds_to_run)

        # kill atop and xentop:
        # don't kill atop with 9!  Give it a chance to shut down
        # process accounting in the kernel with 15 (the default).
        # There's no need to kill the signaller, it will die with atop with
        #     OSError: [Errno 3] No such process

        self._log("TCCPUload: killing atop (%s) and xentop (%s)" %
                  (self.atop_pid, self.xentop_pid))
        self._run0("kill %s %s" % (self.atop_pid, self.xentop_pid))
        # wait till atop is really terminated.
        # ideas:
        # check if either /proc/[pid] no longer exists, or if new process has a different /proc/%{pid}/stat:starttime

        # using inotifywait on the logfile could also do it:
        # "inotifywait -e CLOSE_WRITE %s" % self.atopLogFile
        # but we would need to setup the inotifywait, before we send the kill (otherwise the kill might be to fast.)
        # employing `fuser' on the log-file could also work.

        # here's the hacky solution:
        time.sleep(5)
        # now we gather the logfiles:
        self._log("TCCPUload: extracting log-files")
        logs = [
            self._run0("cat %s" % self.atopLogFile),
            self._run0("cat %s" % self.xentopLogFile)
        ]
        local_logFiles = map(libperf.createLogName, ["atop", "xentop"])

        [
            libperf.outputToResultsFile(logFile, log, addNewline=False)
            for (logFile, log) in zip(local_logFiles, logs)
        ]

        self._log("TCCPUload: Wrote log-files")
Пример #4
0
    def run(self, arglist=[]):
        # ask atop for first sample.
#        self.signaller_pid = self._run0bg ("%s %s" % ('signaller',
#                                                      self.atop_pid))

        self.signaller_pid = self.remoteRun (self.master,
                scripts['signaller'], self.atop_pid, background=True)

        self.xentop_pid = self._run0bg ("xentop --batch --delay 1", self.xentopLogFile)


        time.sleep (self.seconds_to_run)

        # kill atop and xentop:
        # don't kill atop with 9!  Give it a chance to shut down
        # process accounting in the kernel with 15 (the default).
        # There's no need to kill the signaller, it will die with atop with
        #     OSError: [Errno 3] No such process

        self._log ("TCCPUload: killing atop (%s) and xentop (%s)" % (self.atop_pid, self.xentop_pid))
        self._run0 ("kill %s %s" % (self.atop_pid, self.xentop_pid))
        # wait till atop is really terminated.
        # ideas:
        # check if either /proc/[pid] no longer exists, or if new process has a different /proc/%{pid}/stat:starttime

        # using inotifywait on the logfile could also do it:
        # "inotifywait -e CLOSE_WRITE %s" % self.atopLogFile
        # but we would need to setup the inotifywait, before we send the kill (otherwise the kill might be to fast.)
        # employing `fuser' on the log-file could also work.

        # here's the hacky solution:
        time.sleep (5)
        # now we gather the logfiles:
        self._log ("TCCPUload: extracting log-files")
        logs = [self._run0 ("cat %s" % self.atopLogFile), self._run0 ("cat %s" % self.xentopLogFile)]
        local_logFiles = map(libperf.createLogName, ["atop","xentop"])

        [libperf.outputToResultsFile(logFile, log, addNewline=False)
         for (logFile, log) in zip(local_logFiles, logs)]

        self._log ("TCCPUload: Wrote log-files")