コード例 #1
0
ファイル: base.py プロジェクト: lpinca/openwhistleblowing
    def stats_collection_end(self):
        if self.monitor is not None:
            try:
                self.monitor.stop()
            except:
                pass
            finally:
                self.monitor = None

        current_run_time = time.time() - self.start_time

        # discard empty cicles from stats
        if current_run_time > 0.00:
            self.mean_time = ((self.mean_time * self.iterations) +
                              current_run_time) / (self.iterations + 1)

        if self.low_time == -1 or current_run_time < self.low_time:
            self.low_time = current_run_time

        if self.high_time == -1 or current_run_time > self.high_time:
            self.high_time = current_run_time

        log.time_debug(
            "Ended job [%s] with an execution time of %.2f seconds" %
            (self.name, current_run_time))

        self.iterations += 1

        TimingStatsHandler.log_measured_timing("JOB", self.name,
                                               self.start_time,
                                               current_run_time)
コード例 #2
0
    def stats_collection_end(self):
        if self.monitor is not None:
            try:
                self.monitor.stop()
            except:
                pass
            finally:
                self.monitor = None

        current_run_time = time.time() - self.start_time

        # discard empty cicles from stats
        if current_run_time > 0.00:
            self.mean_time = ((self.mean_time * self.iterations) + current_run_time) / (self.iterations + 1)

        if self.low_time == -1 or current_run_time < self.low_time:
            self.low_time = current_run_time

        if self.high_time == -1 or current_run_time > self.high_time:
            self.high_time = current_run_time

        log.time_debug("Ended job [%s] with an execution time of %.2f seconds" % (self.name, current_run_time))

        self.iterations += 1

        TimingStatsHandler.log_measured_timing("JOB", self.name, self.start_time, current_run_time)
コード例 #3
0
ファイル: base.py プロジェクト: nsfw/GlobaLeaks
    def stats_collection_start(self):
        self.monitor = ResourceMonitor(("[Job %s]" % self.name), JOB_MONITOR_TIME)

        self.start_time = time.time()

        if self.mean_time != -1:
            log.time_debug("Starting job [%s] expecting an execution time of %.2f [low: %.2f, high: %.2f]" %
                      (self.name, self.mean_time, self.low_time, self.high_time))
        else:
            log.time_debug("Starting job [%s]" % self.name)
コード例 #4
0
ファイル: base.py プロジェクト: corvolino/GlobaLeaks
    def stats_collection_start(self):
        self.monitor = JobMonitor(self, self.monitor_time)

        self.start_time = time.time()

        if self.mean_time != -1:
            log.time_debug("Starting job [%s] expecting an execution time of %.2f [low: %.2f, high: %.2f]" %
                      (self.name, self.mean_time, self.low_time, self.high_time))
        else:
            log.time_debug("Starting job [%s]" % self.name)
コード例 #5
0
ファイル: base.py プロジェクト: lpinca/openwhistleblowing
    def stats_collection_start(self):
        self.monitor = JobMonitor(self, self.monitor_time)

        self.start_time = time.time()

        if self.mean_time != -1:
            log.time_debug(
                "Starting job [%s] expecting an execution time of %.2f [low: %.2f, high: %.2f]"
                % (self.name, self.mean_time, self.low_time, self.high_time))
        else:
            log.time_debug("Starting job [%s]" % self.name)
コード例 #6
0
ファイル: base.py プロジェクト: nsfw/GlobaLeaks
    def stats_collection_start(self):
        self.monitor = ResourceMonitor(("[Job %s]" % self.name),
                                       JOB_MONITOR_TIME)

        self.start_time = time.time()

        if self.mean_time != -1:
            log.time_debug(
                "Starting job [%s] expecting an execution time of %.2f [low: %.2f, high: %.2f]"
                % (self.name, self.mean_time, self.low_time, self.high_time))
        else:
            log.time_debug("Starting job [%s]" % self.name)
コード例 #7
0
ファイル: base.py プロジェクト: sshyran/GlobaLeaks
    def stats_collection_start(self):
        if self.mean_time != -1:
            log.time_debug("Starting job %s expecting an execution time of %.4f [iterations: %d low: %.4f, high: %.4f]" %
                           (self.name, self.mean_time, self.job_runs, self.low_time, self.high_time))
        else:
            log.time_debug("Starting job %s" % self.name)

        self.monitor_runs = 0
        self.start_time = time.time()
        self.job_runs += 1

        self.monitor.start(self.monitor_time, False)
コード例 #8
0
ファイル: base.py プロジェクト: sshyran/GlobaLeaks
    def stats_collection_end(self):
        if self.monitor.running:
            self.monitor.stop()

        current_run_time = time.time() - self.start_time

        # discard empty cicles from stats
        if current_run_time > 0.000000:
            self.mean_time = ((self.mean_time * (self.job_runs - 1)) + current_run_time) / self.job_runs

        if self.low_time == -1 or current_run_time < self.low_time:
            self.low_time = current_run_time

        if self.high_time == -1 or current_run_time > self.high_time:
            self.high_time = current_run_time

        log.time_debug("Job %s ended with an execution time of %.4f seconds" % (self.name, current_run_time))

        TimingStatsHandler.log_measured_timing("JOB", self.name, self.start_time, current_run_time)