https://github.com/wechuli/actionsprofiler
GitHub Action to collect system metrics during the lifecycle of a job
https://github.com/wechuli/actionsprofiler
Last synced: 5 months ago
JSON representation
GitHub Action to collect system metrics during the lifecycle of a job
- Host: GitHub
- URL: https://github.com/wechuli/actionsprofiler
- Owner: wechuli
- License: mit
- Created: 2025-01-14T14:48:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-15T05:08:47.000Z (over 1 year ago)
- Last Synced: 2026-01-13T02:52:14.744Z (5 months ago)
- Language: TypeScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# System Metrics Collector GitHub Action
This GitHub Action collects system metrics through the lifecycle of a job using Prometheus. The collected metrics can be used to diagnose issues with the build.
## Usage
To use this action in your workflow, add the following step to your `.github/workflows/metrics-collector.yml` file:
```yaml
name: Collect System Metrics
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Collect system metrics
uses: wechuli/actionsprofiler@v1
with:
job_name: 'build-job'
- name: Build
run: npm run build
- name: Upload metrics
uses: actions/upload-artifact@v2
with:
name: system-metrics
path: metrics.txt
```
## Examples
Here are some examples of how to use the System Metrics Collector GitHub Action in your workflows:
### Example 1: Basic Usage
```yaml
name: Collect System Metrics
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Collect system metrics
uses: wechuli/actionsprofiler@v1
with:
job_name: 'build-job'
- name: Build
run: npm run build
- name: Upload metrics
uses: actions/upload-artifact@v2
with:
name: system-metrics
path: metrics.txt
```
### Example 2: Custom Job Name
```yaml
name: Collect System Metrics
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Collect system metrics
uses: wechuli/actionsprofiler@v1
with:
job_name: 'custom-job'
- name: Build
run: npm run build
- name: Upload metrics
uses: actions/upload-artifact@v2
with:
name: system-metrics
path: metrics.txt
```
## Inputs
| Input | Description | Required | Default |
|-----------|--------------------------------------------------|----------|---------------|
| job_name | The name of the job for which metrics are being collected. | true | default-job |
## Outputs
This action does not produce any outputs.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.