Skip to content

Instantly share code, notes, and snippets.

@alexellis
Last active February 27, 2024 06:56
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save alexellis/1f33e581c75e11e161fe613c46180771 to your computer and use it in GitHub Desktop.
Metering for GitHub Actions

Running vmmeter outside of GitHub Actions

Download arkade, then crane:

curl https://get.arkade.dev | sudo sh
sudo -E arkade oci install ghcr.io/openfaasltd/vmmeter:latest --path /usr/local/bin/

Start the vmmeter in the background:

/usr/local/bin/vmmeter &

Check logs:

cat /tmp/vmmeter.log

Collect results at end of build or step:

curl http://127.0.0.1:$(cat /tmp/vmmeter.port)/collect

Running vmmeter inside GitHub Actions

This action will work with a Linux VM environment, so with a hosted runner or with actuated. It may not work when used within the containers: section of a workflow, or with a Kubernetes-based runner.

Add to the top of your GitHub action:

steps:

# vmmeter start
        - uses: alexellis/setup-arkade@master
        - name: Install vmmeter
          run: |
            sudo -E arkade oci install ghcr.io/openfaasltd/vmmeter:latest --path /usr/local/bin/
        - uses: self-actuated/vmmeter-action@master
# vmmeter end

The output will be added to your job summary:

Total RAM: 61.2GB
Total vCPU: 32
Load averages:
Max 1 min: 5.63 (17.59%)
Max 5 min: 1.25 (3.91%)
Max 15 min: 0.41 (1.28%)


RAM usage (10 samples):
Max RAM usage: 2.528GB


Max 10s avg RAM usage: 1.73GB
Max 1 min avg RAM usage: 1.208GB
Max 5 min avg RAM usage: 1.208GB


Disk read: 374.2MB
Disk write: 458.2MB
Max disk I/O inflight: 0
Free: 45.57GB	Used: 4.249GB	(Total: 52.52GB)


Egress adapter RX: 271.4MB
Egress adapter TX: 1.535MB


Entropy min: 256
Entropy max: 256


Max open connections: 125
Max open files: 1696
Processes since boot: 18081


Run time: 45s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment