Skip to content

Commit caecf90

Browse files
massongitclaudegithub-actions[bot]
authored
feat: add per-step metrics collection and rendering (#203)
* feat: add per-step metrics collection and rendering Fetch workflow jobs via Octokit API and split collected metrics by each step's time range. Render per-step charts under collapsible <details> tags alongside the existing "All" chart. - Add github_token input to action.yml - Add @octokit/action and @actions/github dependencies - Restructure render data model: split metricsInfoList into separate legends and stackedBarData to support multiple charts per section - Add formatChartHeader/Footer for step-level <details> wrapping - Add n/no-unpublished-import ESLint rule with ignoreTypeImport - Update README (EN/JA) with per-step metrics documentation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix format (#204) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix format (#211) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix format (#217) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix format (#222) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix format (#230) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix format (#243) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix format (#250) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix format (#254) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix format (#258) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0fbf96c commit caecf90

13 files changed

Lines changed: 22202 additions & 292 deletions

README.ja.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
## 機能
1212

1313
- **システムメトリクス収集**: ワークフロー実行中のCPU負荷とメモリ使用量をリアルタイムで収集
14+
- **ステップ別メトリクス**: GitHub APIを使用してワークフローの各ステップごとにメトリクスを分割
1415
- **Mermaidチャート生成**: 収集したメトリクスをMermaid形式の積み上げ棒グラフとして可視化
1516
- **ジョブサマリー出力**: GitHub Actionsのジョブサマリーに自動的にチャートを表示
1617

@@ -52,6 +53,8 @@ jobs:
5253
# ワークフローの先頭でactions-workflow-metricsを実行
5354
- name: Start Workflow Telemetry
5455
uses: dev-hato/actions-workflow-metrics@v1
56+
with:
57+
github_token: ${{ secrets.GITHUB_TOKEN }}
5558

5659
# 以降の通常のステップ
5760
- name: Checkout
@@ -78,6 +81,7 @@ jobs:
7881
- `systeminformation`: システムメトリクス収集
7982
- `zod`: スキーマバリデーション
8083
- `@actions/core`: GitHub Actions連携
84+
- `@octokit/action`: ステップ別メトリクス取得用GitHub APIクライアント
8185

8286
## 開発セットアップ
8387

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ A GitHub Actions for collecting system metrics during workflows and outputting M
77
## Features
88

99
- **System Metrics Collection**: Collects CPU load and memory usage in real-time during workflow execution
10+
- **Per-Step Metrics**: Breaks down metrics for each workflow step using the GitHub API
1011
- **Mermaid Chart Generation**: Visualizes collected metrics as Mermaid stacked bar charts
1112
- **Job Summary Output**: Automatically displays charts in GitHub Actions job summary
1213

@@ -48,6 +49,8 @@ jobs:
4849
# Run actions-workflow-metrics at the beginning of the workflow
4950
- name: Start Workflow Telemetry
5051
uses: dev-hato/actions-workflow-metrics@v1
52+
with:
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
5154

5255
# Subsequent regular steps
5356
- name: Checkout
@@ -74,6 +77,7 @@ jobs:
7477
- `systeminformation`: System metrics collection
7578
- `zod`: Schema validation
7679
- `@actions/core`: GitHub Actions integration
80+
- `@octokit/action`: GitHub API client for per-step metrics
7781

7882
## Development Setup
7983

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ description: "A GitHub Actions for collecting system metrics during workflows an
44
branding:
55
color: green
66
inputs:
7+
github_token:
8+
description: "GitHub access token"
9+
default: ${{ github.token }}
10+
required: false
711
interval_seconds:
812
description: "Interval between metrics collection in seconds"
913
default: "5"

bun.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)