How to: custom metric, but the aggregation is chosen through arguments? #2495
viktor-ktorvi
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I want to implement a lot of custom metrics and for each to have min, mean, max, or concat aggregations. The way I've done this before involves a lot of boilerplate, and with the amount of different metrics I'm implementing it's getting tedious and leaves a lot of room for error. I'd like to know if there's an easy way to set the aggregation by providing an argument to the constructor of the custom metric.
This is roughly how I do things now:
Ideally, what I'd like is the following:
Is there a nice way to do this already?
Best I've come up with is a metric factory that will inherit dynamically but I feel like it's a bit hacky and confusing.
Thanks! Hope I clearly stated the problem.
Beta Was this translation helpful? Give feedback.
All reactions