Refactoring metrics helpers in the workflow - #94
Conversation
c08dc28 to
8c890f2
Compare
02strich
left a comment
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
I think I'll add a unit test to this that lists all metrics and what labels they should have
There was a problem hiding this comment.
@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.
8c890f2 to
0aaf557
Compare
What was changed
Why?
A lot of redundant and verbose code for emitting metrics
Checklist
Closes
How was this tested: