Repository navigation
feat(service): label review jobs with their strength #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,15 +118,18 @@ export class Metrics { | |
| this.jobsActive.add(1, { type }); | ||
| } | ||
|
|
||
| /** A review carries the strength it ran at, so cost per review can be read per strength. */ | ||
| jobFinished( | ||
| type: string, | ||
| outcome: 'done' | 'failed' | 'invalid', | ||
| retry: boolean, | ||
| seconds?: number | ||
| seconds?: number, | ||
| strength?: Strength | ||
| ): void { | ||
| if (outcome !== 'invalid') this.jobsActive.add(-1, { type }); | ||
| this.jobs.add(1, { type, outcome, retry: String(retry) }); | ||
| if (seconds !== undefined) this.jobDuration.record(seconds, { type, outcome }); | ||
| const labels = { type, ...(strength && { strength }) }; | ||
| this.jobs.add(1, { ...labels, outcome, retry: String(retry) }); | ||
|
Comment on lines
+130
to
+131
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update the documented job metric labels The README metrics table at rows 202–203 still lists the old label sets, so it no longer describes the labels emitted for review jobs. Please update those rows to note that Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/service/src/metrics.ts
Line: 130-131
Comment:
**Update the documented job metric labels**
The README metrics table at rows 202–203 still lists the old label sets, so it no longer describes the labels emitted for review jobs. Please update those rows to note that `strength` is present for reviews and absent for chat/invalid jobs.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · documentation · Reply if this doesn't apply. |
||
| if (seconds !== undefined) this.jobDuration.record(seconds, { ...labels, outcome }); | ||
| } | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert strength on the job duration histogram too
This only verifies the new label on
hansi_jobs_total; the separately recordedhansi_job_duration_secondslabel is not asserted anywhere. A regression that drops strength from the duration histogram would leave this test passing despite that metric being part of the change.Prompt To Fix With AI
🟡 Minor · testing · Reply if this doesn't apply.