@wolf480pl@mstdn.io @algernon@trunk.mad-scientist.club tbh I prefer passing such an object explicitly instead of it being implicitly carried - I personally value knowing what exactly from current scope is passed into the function I'm calling. Overall, I think that code is fine.
Though honestly you also could've avoided this by going in reverse - returning MetricsSet's from functions that you merge and tag - and it would've avoided mutable objects and bug potential from using them (e.g. in line 192 you are taking the exporter from previous operation and getting a new one with updated labels - which might end up not quite how you want after modifying code). Which I'd say is a more functional solution actually, and with less potential for error
Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
Ignas Kiela (ignaloidas@not.acu.lt)'s status on Tuesday, 25-Jun-2024 17:43:29 JSTIgnas Kiela