π Askrella GitHub Actions Resource Monitor

A lightweight system resource monitoring daemon that tracks CPU, memory, storage, and network usage during GitHub Actions workflows. The collected metrics are visualized as graphs and can be posted as a comment on the associated Pull Request.
Developed by and for Askrella β’ Core Maintainer: @steve-hb
β¨ Features
- π₯οΈ System Metrics Collection: Monitors CPU, memory, disk, and network usage
- βοΈ Configurable Monitoring: Adjust sampling intervals and choose which metrics to collect
- π Visualization: Generates time-series graphs for all collected metrics
- π GitHub Integration: Posts results directly to GitHub Pull Requests
- π Low Overhead: Designed to run alongside CI/CD workflows without significant impact
- β
Code Quality: Enforced through comprehensive golangci-lint configuration
- π Dependency Management: Automated with Dependabot to keep dependencies up-to-date
π Quick Start
Using GitHub Action
Simply add the monitoring action to your workflow:
- name: Monitor Performance
uses: askrella/github-monitoring/.github/actions/monitoring@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
command: "go test ./... -v"
Note: The monitoring daemon runs in the background and will not block your workflow steps.
|
Using Command Line
# Build the tool
go build -o monitor ./cmd/monitor
# Start monitoring
./monitor start --interval 1
# Run your workload
go test ./...
# Stop and generate visualizations
./monitor stop
./monitor visualize
|
π Using as a GitHub Action
This repository provides a reusable GitHub Action that you can use in your own workflows to monitor performance.
Direct Action Usage
- name: Monitor Performance
uses: askrella/github-monitoring/.github/actions/monitoring@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
command: "go test ./... -v"
interval: 1
metrics: "cpu,memory,disk,network"
wait_after_command: 5
Reusable Workflow Usage
name: Performance Test
on:
pull_request:
types: [opened, synchronize]
jobs:
monitor-tests:
uses: askrella/github-monitoring/.github/workflows/reusable-monitoring.yml@main
with:
command: "go test ./... -v"
interval: "1"
metrics: "cpu,memory,disk,network"
secrets:
github_token: ${{ secrets.GITHUB_TOKEN }}
See the GitHub Actions Documentation for more details.
π οΈ Command Line Reference
Monitor Command
monitor start [flags]
| Flag | Description | Default |
--interval, -i | Sampling interval in seconds | 1 |
--output, -o | Path to save metrics data | metrics.json |
--cpu, -c | Collect CPU metrics | true |
--memory, -m | Collect memory metrics | true |
--disk, -d | Collect disk metrics | true |
--network, -n | Collect network metrics | true |
--verbose, -v | Enable verbose logging | false |
Stop Command
monitor stop [flags]
| Flag | Description | Default |
--output, -o | Path to save metrics data | metrics.json |
Visualize Command
monitor visualize [flags]
| Flag | Description | Default |
--input, -i | Path to metrics data file | metrics.json |
--output-dir, -o | Directory to save visualization files | visualizations |
Process Command
monitor process [flags]
| Flag | Description | Default |
--input, -i | Path to metrics data file to process | metrics.json |
--output-dir, -o | Directory to save visualization files | visualizations |
--comment-pr, -p | Whether to comment on the PR with results | false |
--github-token, -t | GitHub token for PR comments | "" (uses GITHUB_TOKEN env var if not provided) |
--verbose, -v | Enable verbose logging | false |
monitor pr-comment [flags]
| Flag | Description | Default |
--report-dir, -r | Directory containing visualization files and report | visualizations |
--token, -t | GitHub token for authentication | |
--owner, -o | GitHub repository owner/organization | |
--repo, -p | GitHub repository name | |
--pr, -n | Pull request number | |
π Output
The monitoring daemon generates the following output:
π JSON Metrics File
Raw metrics data with timestamps for further analysis.
|
π Visualization Files
- CPU Usage
- Per-Core CPU Usage
- Memory Usage
- Disk Usage
- Network Usage
|
π Markdown Report
A comprehensive summary including:
- Statistical analysis
- Performance trends
- Visual graphs
|
π§ͺ Testing
For information on running and writing tests, see the Testing Guide.
π οΈ Building from Source
git clone https://github.com/askrella/github-monitoring.git
cd github-monitoring
go build -o monitor ./cmd/monitor
π Requirements
π License
MIT License
π₯ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.