Add pacplot script
This commit is contained in:
parent
28b0775be9
commit
5866de7915
25
pacplot
Executable file
25
pacplot
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from datetime import datetime
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
with open('/var/log/pacman.log', 'r') as f:
|
||||
cnt = 0
|
||||
x = []
|
||||
y = []
|
||||
for line in f.readlines():
|
||||
if 'PACKAGEKIT' in line:
|
||||
continue
|
||||
if 'installed' in line:
|
||||
cnt += 1
|
||||
elif 'upgraded' in line:
|
||||
pass
|
||||
elif 'removed' in line:
|
||||
cnt -= 1
|
||||
else:
|
||||
continue
|
||||
x.append(datetime.fromisoformat(line[1:23] + ':00'))
|
||||
y.append(cnt)
|
||||
|
||||
plt.scatter(x, y)
|
||||
plt.show()
|
Loading…
Reference in a new issue