Skip to content

Commit 03a7524

Browse files
authored
Add active workflows/day as secondary axis in audit trend chart
2 parents a62cb61 + 1e49ee8 commit 03a7524

3 files changed

Lines changed: 43 additions & 39 deletions

File tree

.github/workflows/agentic-token-audit.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Handle null/missing `ai_credits` and `token_usage` by treating them as 0.
171171
2. Copy it to `/tmp/gh-aw/repo-memory/default/YYYY-MM-DD.json` (today's UTC date).
172172
3. This file is what the optimizer workflow reads to identify high-usage workflows.
173173

174-
Also maintain a rolling summary file at `/tmp/gh-aw/repo-memory/default/rolling-summary.json` that contains an array of daily overall totals (date, total_ai_credits, total_tokens, total_runs, total_action_minutes) for the last 90 entries. Load the existing file, append today's entry, trim to 90, and save.
174+
Also maintain a rolling summary file at `/tmp/gh-aw/repo-memory/default/rolling-summary.json` that contains an array of daily overall totals (date, total_ai_credits, total_tokens, total_runs, total_action_minutes, active_workflows) for the last 90 entries. `active_workflows` must be the count of distinct workflows with `run_count >= 1` in that day's snapshot. Load the existing file, append today's entry, trim to 90, and save.
175175

176176
Do not append a synthetic zero-valued entry to `rolling-summary.json` when either of these conditions is true:
177177

@@ -185,14 +185,16 @@ Report those two cases differently in the issue as described below so the empty-
185185
Create up to two chart images in `/tmp/gh-aw/token-audit/charts/` using Python, `matplotlib`, and `seaborn` with `whitegrid` styling:
186186

187187
1. **AI credit spend by workflow** (`ai_credits_by_workflow.png`): a horizontal bar chart of the top 15 workflows by total AI credits from `audit_snapshot.json`.
188-
2. **Historical AI credit trend** (`ai_credits_trend.png`): a line chart from `rolling-summary.json`.
188+
2. **Historical AI credit trend** (`ai_credits_trend.png`): a dual-axis line chart from `rolling-summary.json` with total AI credits on the primary y-axis and active workflows/day on the secondary y-axis.
189189

190190
Chart requirements:
191191

192192
- The preinstalled Python packages live in `/tmp/gh-aw/token-audit/site-packages`. Set `PYTHONPATH=/tmp/gh-aw/token-audit/site-packages${PYTHONPATH:+:$PYTHONPATH}` for every Python command that imports `pandas`, `matplotlib`, or `seaborn`, for example: `PYTHONPATH=/tmp/gh-aw/token-audit/site-packages${PYTHONPATH:+:$PYTHONPATH} python3 /tmp/gh-aw/token-audit/process_audit.py`.
193193
- Use 300 DPI and a white background.
194194
- Add clear axis labels and titles.
195195
- Save only PNG files.
196+
- For `ai_credits_trend.png`, label the secondary y-axis as `Active workflows/day` (or `Distinct workflows executed`) and plot daily distinct executed workflows from `active_workflows`.
197+
- Do not plot the total number of workflows defined in the repository.
196198
- If there are fewer than 2 rolling-summary points, skip the trend chart and explain why in the issue.
197199
- After generating each chart, call `upload_asset` with its file path.
198200
- In the issue template below, replace `UPLOAD_URL_WORKFLOW_PLACEHOLDER` with the URL returned for `ai_credits_by_workflow.png`.
@@ -236,7 +238,7 @@ Embed chart images using uploaded asset URLs when available:
236238
237239
![Historical AI Credit Trend](UPLOAD_URL_TREND_PLACEHOLDER)
238240
239-
Summarize AI credit and token changes from `rolling-summary.json` when historical data is available.
241+
Summarize AI credit, token, and active-workflow changes from `rolling-summary.json` when historical data is available.
240242
241243
<details>
242244
<summary><b>Full Per-Workflow Breakdown</b></summary>

workflows/agentic-token-audit.lock.yml

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

0 commit comments

Comments
 (0)