Skip to content

Refactoring metrics helpers in the workflow - #94

Open
seanbollin wants to merge 1 commit into
mainfrom
sean-metrics-recorders
Open

Refactoring metrics helpers in the workflow#94
seanbollin wants to merge 1 commit into
mainfrom
sean-metrics-recorders

Conversation

@seanbollin

@seanbollin seanbollin commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What was changed

Why?

A lot of redundant and verbose code for emitting metrics

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@seanbollin
seanbollin force-pushed the sean-metrics-recorders branch 2 times, most recently from c08dc28 to 8c890f2 Compare July 23, 2026 20:41
@seanbollin
seanbollin marked this pull request as ready for review July 23, 2026 20:54
@seanbollin
seanbollin requested a review from a team as a code owner July 23, 2026 20:54

@02strich 02strich left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The private type names could be a bit more explicit to metrics, but otherwise looks like a nice improvement.

@@ -0,0 +1,170 @@
package workflow

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll add a unit test to this that lists all metrics and what labels they should have

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanbollin That kind of a unit test generally just provides friction when evolving the set of metrics, in my experience. Better to skip that kind of a unit test (that really is just going to be a repeat of the const/var definitions in wci/metrics/metrics_defs.go) and instead focus on tests that verify the value of a particular metric has been updated in an expected way during a single execution of some unit of work -- for example, that a particular counter is incremented or that a duration is within an acceptable range.

@seanbollin
seanbollin force-pushed the sean-metrics-recorders branch from 8c890f2 to 0aaf557 Compare July 23, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants