5 self
.vmstat_file
= open('/proc/vmstat')
6 self
.vmstat
= self
.read()
10 return int(line
.split()[1]) * 1024
12 for line
in self
.vmstat_file
:
13 if line
.startswith('pgpgin '):
14 pgpgin
= extract(line
)
17 for line
in self
.vmstat_file
:
18 if line
.startswith('pgpgout '):
19 pgpgout
= extract(line
)
22 self
.vmstat_file
.seek(0)
23 return pgpgin
, pgpgout
27 delta
= now
[0] - self
.vmstat
[0], now
[1] - self
.vmstat
[1]