25 lines
554 B
Python
Executable file
25 lines
554 B
Python
Executable file
#!/usr/bin/python
|
|
|
|
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()
|