Created
November 15, 2024 10:20
-
-
Save tellison/e2736c65cf74c8f9c82d2b83f43ade16 to your computer and use it in GitHub Desktop.
CloudFlare GraphQL query for Adoptium packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| viewer { | |
| zones( | |
| # Filter by adoptium.net zone. | |
| ## Replace <ZONE-TAG> with actual value | |
| filter: {zoneTag: "<ZONE-TAG>"} | |
| ) | |
| { | |
| httpRequestsAdaptiveGroups( | |
| # Limit number of results, and order by ascending date. | |
| limit: 1000, | |
| orderBy: [date_ASC], | |
| filter: { | |
| # Filter by date. | |
| date_geq: "2024-10-01", | |
| date_leq: "2024-10-31", | |
| # Filter by host | |
| clientRequestHTTPHost: "packages.adoptium.net", | |
| # Filter by name, looking for .deb, .rpm, .apk packages. | |
| OR: [ | |
| { | |
| AND: [ | |
| {clientRequestPath_like: "%.deb"}, | |
| {clientRequestPath_notlike: "%/adoptium-ca-certificates%"} | |
| ] | |
| }, | |
| {clientRequestPath_like: "%.rpm"}, | |
| {clientRequestPath_like: "%.apk"} | |
| ], | |
| # Filter by successful requests. | |
| originResponseStatus: 200 | |
| } | |
| ) | |
| { | |
| # Return total matching count. | |
| count | |
| # Group results by date and path. | |
| dimensions { | |
| date | |
| # clientRequestPath | |
| } | |
| } | |
| } | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output based on above, but using filter dates between Nov 1 to Nov 7.
These are the daily counts for all .deb, .rpm, and .apk packages:
{ "data": { "viewer": { "zones": [ { "httpRequestsAdaptiveGroups": [ { "count": 20491, "dimensions": { "date": "2024-11-01" } }, { "count": 9810, "dimensions": { "date": "2024-11-02" } }, { "count": 9907, "dimensions": { "date": "2024-11-03" } }, { "count": 23683, "dimensions": { "date": "2024-11-04" } }, { "count": 19257, "dimensions": { "date": "2024-11-05" } }, { "count": 18045, "dimensions": { "date": "2024-11-06" } }, { "count": 19508, "dimensions": { "date": "2024-11-07" } } ] } ] } }, "errors": null }