29 lines
744 B
Python
29 lines
744 B
Python
import json
|
|
from datetime import datetime
|
|
from itertools import pairwise
|
|
|
|
import matplotlib.pyplot as plt
|
|
import numpy as np
|
|
|
|
plt.rcParams["figure.figsize"] = [18, 9]
|
|
plt.style.use("dark_background")
|
|
plt.subplots_adjust(left=0.05, right=0.99, top=0.95, bottom=0.05)
|
|
|
|
with open("commits.json", "r") as file:
|
|
pages = json.load(file)
|
|
times = []
|
|
for commit in pages:
|
|
times.append(datetime.strptime(commit["created"], "%Y-%m-%dT%H:%M:%SZ"))
|
|
deltas = []
|
|
for a, b in pairwise(times):
|
|
deltas.append((a - b))
|
|
deltas.sort()
|
|
print("start")
|
|
for delta in deltas:
|
|
print(delta)
|
|
X = np.arange(len(deltas))
|
|
Y = np.array([delta.total_seconds() for delta in deltas])
|
|
plt.gca().set_yscale("log")
|
|
plt.scatter(X, Y, s=2.0)
|
|
plt.savefig("commits.png")
|