-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkflow_run_stats.py
76 lines (72 loc) · 2.03 KB
/
workflow_run_stats.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import matplotlib.pyplot as plt
from datetime import datetime
# Parsed from GitHub API
pushes = [
"2024-04-06T12:43:49Z",
"2024-04-06T11:43:21Z",
"2024-04-06T08:49:00Z",
"2024-04-05T09:56:28Z",
"2024-04-05T09:35:59Z",
"2024-04-05T08:27:22Z",
"2024-04-04T16:15:38Z",
"2024-04-04T14:54:06Z",
"2024-04-04T09:44:11Z",
"2024-04-03T09:55:08Z",
"2024-04-02T18:46:37Z",
"2024-04-02T17:55:02Z",
"2024-04-02T17:25:10Z",
"2024-04-02T17:04:22Z",
"2024-04-02T13:59:15Z",
"2024-04-02T12:03:36Z",
"2024-04-02T10:42:31Z",
"2024-04-01T18:07:47Z",
"2024-04-01T16:46:02Z",
"2024-04-01T15:23:24Z",
"2024-04-01T15:16:31Z",
"2024-04-01T14:55:05Z",
"2024-04-01T14:24:11Z",
"2024-03-29T16:20:14Z",
"2024-03-29T14:56:33Z",
"2024-03-27T01:11:21Z",
"2024-03-26T12:33:28Z",
"2024-03-25T14:47:33Z",
"2024-03-20T16:38:32Z",
"2024-03-15T12:19:32Z",
"2024-03-14T16:05:02Z",
"2024-03-14T14:32:13Z",
"2024-03-14T14:06:43Z",
"2024-03-14T13:43:03Z",
"2024-03-13T21:51:14Z",
"2024-03-13T00:04:47Z",
"2024-03-12T13:01:41Z",
"2024-03-12T12:09:47Z",
"2024-03-11T18:15:03Z",
"2024-03-11T15:53:25Z",
"2024-03-11T15:43:37Z",
"2024-03-11T13:34:09Z",
"2024-03-11T10:46:03Z",
"2024-03-11T06:01:30Z",
"2024-03-08T23:05:43Z",
"2024-03-08T16:35:49Z",
]
pushes = [datetime.fromisoformat(dt_str) for dt_str in pushes]
# Manually entered from NewRelic
alerts = [
"Apr 5, 2024 10:46am",
"Apr 4, 2024 4:39pm",
"Apr 3, 2024 10:17am",
"Apr 2, 2024 6:19pm",
"Apr 2, 2024 2:25pm",
"Mar 29, 2024 9:56am",
"Mar 29, 2024 9:56am",
"Mar 26, 2024 12:59pm",
"Mar 12, 2024 1:31pm",
"Mar 12, 2024 12:35pm",
"Mar 11, 2024 1:59pm",
"Mar 8, 2024 5:07pm",
]
alerts = [datetime.strptime(dt_str, "%b %d, %Y %I:%M%p") for dt_str in alerts]
fig, ax = plt.subplots()
ax.plot_date(pushes, [1 for _ in range(len(pushes))], color="green")
ax.plot_date(alerts, [1 for _ in range(len(alerts))], color="red")
plt.show()