Skip to content

Instantly share code, notes, and snippets.

@bukzor
Last active December 11, 2024 15:52
Show Gist options
  • Save bukzor/8f39bb6056a104588181c6029ae26a04 to your computer and use it in GitHub Desktop.
Save bukzor/8f39bb6056a104588181c6029ae26a04 to your computer and use it in GitHub Desktop.
GitHub GraphQL to retrieve run times for a particular GHA job
name startedAt completedAt conclusion detailsUrl duration
self-hosted-end-to-end 2024-11-26T15:46:09Z 2024-11-26T16:07:08Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12034154894/job/33550021806 1259
self-hosted-end-to-end 2024-11-26T16:47:29Z 2024-11-26T17:14:01Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12035220718/job/33553661370 1592
self-hosted-end-to-end 2024-11-26T16:48:18Z 2024-11-26T17:12:22Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12035235305/job/33553709892 1444
self-hosted-end-to-end 2024-11-26T16:53:44Z 2024-11-26T17:14:11Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12035327143/job/33554017768 1227
self-hosted-end-to-end 2024-11-26T16:56:25Z 2024-11-26T17:15:59Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12035373227/job/33554176510 1174
self-hosted-end-to-end 2024-11-27T15:27:57Z 2024-11-27T15:56:07Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12053427269/job/33609068458 1690
self-hosted-end-to-end 2024-11-27T18:15:47Z 2024-11-27T18:37:11Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12056078686/job/33617828418 1284
self-hosted-end-to-end 2024-11-27T18:40:10Z 2024-11-27T19:01:04Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12056419427/job/33618884707 1254
self-hosted-end-to-end 2024-11-27T19:14:47Z 2024-11-27T19:35:03Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12056874487/job/33620301730 1216
self-hosted-end-to-end 2024-12-02T17:08:17Z 2024-12-02T17:31:50Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12124349361/job/33801881105 1413
self-hosted-end-to-end 2024-12-02T19:46:50Z 2024-12-02T20:08:18Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12126808538/job/33809696890 1288
self-hosted-end-to-end 2024-12-02T19:47:39Z 2024-12-02T20:08:49Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12126819745/job/33809730858 1270
self-hosted-end-to-end 2024-12-02T19:49:27Z 2024-12-02T20:09:37Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12126845888/job/33809810841 1210
self-hosted-end-to-end 2024-12-02T20:25:22Z 2024-12-02T20:45:26Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12127377516/job/33811504508 1204
self-hosted-end-to-end 2024-12-03T10:05:05Z 2024-12-03T10:24:26Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12137327836/job/33840340167 1161
self-hosted-end-to-end 2024-12-03T12:43:19Z 2024-12-03T13:03:54Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12139906174/job/33848508447 1235
self-hosted-end-to-end 2024-12-03T13:15:35Z 2024-12-03T13:35:45Z FAILURE https://github.com/getsentry/snuba/actions/runs/12140449701/job/33850271731 1210
self-hosted-end-to-end 2024-12-03T14:13:52Z 2024-12-03T14:34:18Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12141486696/job/33853695052 1226
self-hosted-end-to-end 2024-12-03T17:09:44Z 2024-12-03T17:29:41Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12144669403/job/33864565072 1197
self-hosted-end-to-end 2024-12-03T18:58:27Z 2024-12-03T19:19:42Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12146365854/job/33870117448 1275
self-hosted-end-to-end 2024-12-03T18:59:19Z 2024-12-03T19:19:19Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12146377168/job/33870156713 1200
self-hosted-end-to-end 2024-12-03T20:29:33Z 2024-12-03T20:49:32Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12147591019/job/33874166225 1199
self-hosted-end-to-end 2024-12-03T20:57:29Z 2024-12-03T21:19:50Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12147981097/job/33875439117 1341
self-hosted-end-to-end 2024-12-03T21:27:17Z 2024-12-03T21:46:56Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12148411004/job/33876817977 1179
self-hosted-end-to-end 2024-12-03T22:43:54Z 2024-12-03T23:03:57Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12149439397/job/33880109583 1203
self-hosted-end-to-end 2024-12-03T22:50:14Z 2024-12-03T23:10:23Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12149516699/job/33880352189 1209
self-hosted-end-to-end 2024-12-04T16:28:31Z 2024-12-04T16:48:25Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12164077681/job/33924841983 1194
self-hosted-end-to-end 2024-12-04T17:05:40Z 2024-12-04T17:25:27Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12164708282/job/33927015960 1187
self-hosted-end-to-end 2024-12-04T17:13:47Z 2024-12-04T17:33:34Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12164844886/job/33927474582 1187
self-hosted-end-to-end 2024-12-04T18:37:28Z 2024-12-04T19:12:28Z FAILURE https://github.com/getsentry/snuba/actions/runs/12166158454/job/33931765338 2100
self-hosted-end-to-end 2024-12-04T18:39:07Z 2024-12-04T19:07:48Z SKIPPED https://github.com/getsentry/snuba/actions/runs/12165616420/job/33931849030 1721
self-hosted-end-to-end 2024-12-04T19:13:08Z 2024-12-04T19:48:07Z FAILURE https://github.com/getsentry/snuba/actions/runs/12166657122/job/33933401686 2099
self-hosted-end-to-end 2024-12-04T22:47:36Z 2024-12-04T23:07:47Z FAILURE https://github.com/getsentry/snuba/actions/runs/12169684771/job/33943132136 1211
self-hosted-end-to-end 2024-12-05T08:26:39Z 2024-12-05T08:46:54Z FAILURE https://github.com/getsentry/snuba/actions/runs/12175913100/job/33960581835 1215
self-hosted-end-to-end 2024-12-05T08:56:00Z 2024-12-05T09:31:00Z FAILURE https://github.com/getsentry/snuba/actions/runs/12176361375/job/33961948334 2100
self-hosted-end-to-end 2024-12-05T18:08:31Z 2024-12-05T18:39:19Z FAILURE https://github.com/getsentry/snuba/actions/runs/12170306681/job/33991965274 1848
self-hosted-end-to-end 2024-12-05T19:26:16Z 2024-12-05T20:01:15Z FAILURE https://github.com/getsentry/snuba/actions/runs/12185697385/job/33995693879 2099
self-hosted-end-to-end 2024-12-05T20:07:30Z 2024-12-05T20:42:28Z FAILURE https://github.com/getsentry/snuba/actions/runs/12187239221/job/33997581192 2098
self-hosted-end-to-end 2024-12-05T20:07:37Z 2024-12-05T20:37:00Z CANCELLED https://github.com/getsentry/snuba/actions/runs/12167008311/job/33997588870 1763
self-hosted-end-to-end 2024-12-05T20:12:03Z 2024-12-05T20:47:01Z FAILURE https://github.com/getsentry/snuba/actions/runs/12187305445/job/33997795397 2098
self-hosted-end-to-end 2024-12-05T20:55:20Z 2024-12-05T21:30:19Z FAILURE https://github.com/getsentry/snuba/actions/runs/12187900509/job/33999727629 2099
self-hosted-end-to-end 2024-12-05T21:17:54Z 2024-12-05T21:52:27Z FAILURE https://github.com/getsentry/snuba/actions/runs/12170258311/job/34000727558 2073
self-hosted-end-to-end 2024-12-06T17:50:15Z 2024-12-06T18:10:49Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12203592355/job/34046871843 1234
self-hosted-end-to-end 2024-12-09T19:33:37Z 2024-12-09T19:47:31Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12169772374/job/34151350602 834
self-hosted-end-to-end 2024-12-09T21:48:46Z 2024-12-09T22:07:53Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12244912158/job/34157663208 1147
self-hosted-end-to-end 2024-12-09T22:04:08Z 2024-12-09T22:24:09Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12245118668/job/34158331416 1201
self-hosted-end-to-end 2024-12-09T22:24:28Z 2024-12-09T22:44:03Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12245409807/job/34159228228 1175
self-hosted-end-to-end 2024-12-09T22:49:05Z 2024-12-09T23:08:39Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12245735787/job/34160228286 1174
self-hosted-end-to-end 2024-12-09T23:04:45Z 2024-12-09T23:31:23Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12245920435/job/34160809778 1598
self-hosted-end-to-end 2024-12-10T01:10:55Z 2024-12-10T01:24:50Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12247015099/job/34165116104 835
self-hosted-end-to-end 2024-12-10T01:39:00Z 2024-12-10T01:58:25Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12247702878/job/34166001014 1165
self-hosted-end-to-end 2024-12-10T17:34:03Z 2024-12-10T17:55:44Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12261557997/job/34208841853 1301
self-hosted-end-to-end 2024-12-10T17:36:36Z 2024-12-10T17:57:52Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12261600169/job/34208975572 1276
self-hosted-end-to-end 2024-12-10T17:46:33Z 2024-12-10T18:06:31Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12261755609/job/34209488870 1198
self-hosted-end-to-end 2024-12-10T17:54:29Z 2024-12-10T18:14:43Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12261872562/job/34209880346 1214
self-hosted-end-to-end 2024-12-10T18:26:51Z 2024-12-10T18:48:25Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12262376897/job/34211539133 1294
self-hosted-end-to-end 2024-12-10T18:42:27Z 2024-12-10T19:02:00Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12262612918/job/34212305430 1173
self-hosted-end-to-end 2024-12-10T18:51:08Z 2024-12-10T19:21:22Z FAILURE https://github.com/getsentry/snuba/actions/runs/12262726039/job/34212674330 1814
self-hosted-end-to-end 2024-12-10T18:53:29Z 2024-12-10T19:13:40Z FAILURE https://github.com/getsentry/snuba/actions/runs/12262776841/job/34212838025 1211
self-hosted-end-to-end 2024-12-10T18:54:38Z 2024-12-10T19:14:43Z FAILURE https://github.com/getsentry/snuba/actions/runs/12262792969/job/34212891881 1205
self-hosted-end-to-end 2024-12-10T18:56:26Z 2024-12-10T19:22:50Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12262818202/job/34212975322 1584
self-hosted-end-to-end 2024-12-10T19:04:40Z 2024-12-10T19:26:01Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12262937220/job/34213375337 1281
self-hosted-end-to-end 2024-12-10T19:08:07Z 2024-12-10T19:27:35Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12262991937/job/34213549677 1168
self-hosted-end-to-end 2024-12-10T19:31:44Z 2024-12-10T19:50:41Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12263352224/job/34214705295 1137
self-hosted-end-to-end 2024-12-10T19:34:43Z 2024-12-10T19:54:00Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12263397802/job/34214849068 1157
self-hosted-end-to-end 2024-12-10T19:39:43Z 2024-12-10T20:01:12Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12263473823/job/34215090495 1289
self-hosted-end-to-end 2024-12-10T19:39:55Z 2024-12-10T19:59:58Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12263476781/job/34215096746 1203
self-hosted-end-to-end 2024-12-10T19:40:29Z 2024-12-10T20:09:31Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12263484423/job/34215124636 1742
self-hosted-end-to-end 2024-12-10T19:49:00Z 2024-12-10T20:08:25Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12263602605/job/34215522020 1165
self-hosted-end-to-end 2024-12-10T20:06:48Z 2024-12-10T20:28:55Z SUCCESS https://github.com/getsentry/snuba/actions/runs/12263853880/job/34216383453 1327
query GetWorkflowJobRunTimes {
resource(url: "https://github.com/getsentry/snuba/actions/workflows/ci.yml") {
... on Workflow {
name
runs(first: 100, orderBy: { field: CREATED_AT, direction: DESC }) {
nodes {
createdAt
checkSuite {
checkRuns(
first: 1
filterBy: { checkName: "self-hosted-end-to-end" }
) {
nodes {
name
startedAt
completedAt
conclusion
detailsUrl
}
}
}
}
}
}
}
}
.
| [
.data.resource.runs.nodes[].checkSuite[].nodes[]
| select(.completedAt and .startedAt)
| .duration = (.completedAt | fromdateiso8601) - (.startedAt | fromdateiso8601)
]
| sort_by(.startedAt)
# convert array of objects to CSV
| (.[0] | keys_unsorted) as $keys
| ( $keys
, ( .[] | [.[$keys[]]])
)
| @csv
#!/bin/sh
gh api graphql --field [email protected] |
jq -crf ./workflow-run-times.jq |
tee workflow-run-times.csv \
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment