Queries per Second shields.io badge #1
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
| name: Queries per Second shields.io badge | |
| on: | |
| schedule: | |
| - cron: "0 */6 * * *" # Runs every 6 hours | |
| workflow_dispatch: | |
| jobs: | |
| update-qps-gist: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Calculate QPS | |
| id: qps | |
| uses: docker://cunnie/fedora-golang-bosh | |
| with: | |
| entrypoint: /bin/bash | |
| args: | | |
| -c " | |
| for NS in ns-{do-sg,gce,hetzner,ovh}.sslip.io; do | |
| dig TXT metrics.status.sslip.io @$NS +short | | |
| rg \"Queries:\" | | |
| sed 's/\"Queries.*[(]//; s~/.*$~~g' | |
| done | | |
| awk '{ sum += $1 } END { printf \"qps=%.0f\n\", sum }' \ | |
| > $GITHUB_OUTPUT | |
| " | |
| - name: Create QPS JSON file | |
| run: | | |
| cat > qps.json << EOF | |
| { | |
| "schemaVersion": 1, | |
| "label": "Queries / second", | |
| "message": "${{ steps.qps.outputs.qps }}", | |
| "color": "blue" | |
| } | |
| EOF | |
| - name: Update Gist with QPS data | |
| uses: exuanbo/actions-deploy-gist@v1 | |
| with: | |
| token: ${{ secrets.GIST_TOKEN }} | |
| gist_id: 67dc2a78c9ac6032db05027727c63ea1 | |
| file_path: qps.json |