Lines Matching +full:min +full:- +full:sample +full:- +full:time

2 # SPDX-License-Identifier: GPL-2.0-only
6 # like open log files and the time of the last sampling.
8 import time
26 # environments like Linux-VServer. Silently skip collecting
37 # Last time that we sampled /proc data resp. recorded disk monitoring data.
40 # Minimum number of seconds between recording a sample. This
57 def _reduce_meminfo(self, time, data): argument
68 return (time,
78 def _reduce_diskstats(self, time, data): argument
90 # We need to compute information about the time interval
91 # since the last sampling and record the result as sample
93 interval = time - self.diskstats_ltime
95 sums = [ a - b for a, b in zip(diskdata, self.diskstats_data) ]
99 util = max(0.0, min(1.0, util))
102 self.diskstats_ltime = time
107 def _reduce_nop(self, time, data): argument
108 return (time, data)
110 def _reduce_stat(self, time, data): argument
118 user = float((times[0] + times[1]) - (self.stat_ltimes[0] + self.stat_ltimes[1]))
119 …system = float((times[2] + times[5] + times[6]) - (self.stat_ltimes[2] + self.stat_ltimes[5] + sel…
120 idle = float(times[3] - self.stat_ltimes[3])
121 iowait = float(times[4] - self.stat_ltimes[4])
124 reduced = (time, (user/aSum, system/aSum, iowait/aSum))
129 def sample(self, event, force): member in SystemStats
130 now = time.time()
131 if (now - self.last_proc > self.min_seconds) or force:
155 ((now - self.last_disk_monitor > self.min_seconds) or force):
158 ''.join(['%s: %d\n' % (dev, sample.total_bytes - sample.free_bytes)
159 for dev, sample in event.disk_usage.items()]).encode('ascii') +