giterator-presets/util/over_time_vis.py
2024-08-25 14:59:10 +02:00

24 lines
543 B
Python

import json
from datetime import datetime
import sys
import matplotlib.pyplot as plt
data = json.loads(sys.stdin.read())
# Extracting datetime and stdout values
datetimes = []
stdout_values = []
for entry in data:
datetimes.append(
datetime.strptime(entry['datetime'], "%Y-%m-%d %H:%M:%S %z"))
stdout_values.append(int(entry['stdout']))
# Plotting
plt.plot(datetimes, stdout_values, marker='o')
plt.xlabel('Datetime')
plt.ylabel('stdout')
plt.title('stdout over Time')
plt.xticks(rotation=45)
plt.tight_layout()
plt.show()