Repository navigation
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #126 +/- ##
===========================================
- Coverage 100.00% 99.34% -0.66%
===========================================
Files 2 2
Lines 145 152 +7
===========================================
+ Hits 145 151 +6
- Misses 0 1 +1
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This is meant for collectors to just use metadata as a whole. The reasoning for that is that in many cases user may know, that all provided metadata will be relevant (especially true for metrics of the current application). Currently the way to extract relevant metrics is to use `Map.take/2`, but that can introduce unwanted slowdown due to requirement of constructing new map even if all keys are selected. In my benchmarking of my project `Map.take/2` (internal `Map.take/3` function to be exact) was responsible for 7.83% of the whole runtime (very tight loop), and I simply take whole metadata into account, so that additional processing is not needed.
a0d84cd to
c0a96a4
Compare
|
I wonder if there are other ways to optimize this. The issue with adding |
|
Actually, I think in many cases projects like Phoenix includes |
|
@josevalim yeah, but the idea there was to not use that as a default but as an optimisation for places where it really is a problem. That way existing metrics gatherers would still work perfectly fine, it was just for that 1% of the cases where that additional function call does matter. |
|
So let's go with a function and deprecate tag_values, because that would allow you to optimize all cases you care about, since you could also rewrite: as: WDYT? |
|
That can be a solution as well. The question is whether we should do the translation to function in Telemetry.Metrics or just add new possible value there? |
|
Doing the translation would be a breaking change, so we need add a new value for formatters to handle. |
|
We can do the translation in the future. So if we deprecate |
This supersedes `tag_values` function. Close beam-telemetry#126
This supersedes `tag_values` function. Close beam-telemetry#126
This supersedes `tag_values` function. Close beam-telemetry#126
This is meant for collectors to just use metadata as a whole. The reasoning for that is that in many cases user may know, that all provided metadata will be relevant (especially true for metrics of the current application). Currently the way to extract relevant metrics is to use
Map.take/2, but that can introduce unwanted slowdown due to requirement of constructing new map even if all keys are selected.In my benchmarking of my project
Map.take/2(internalMap.take/3function to be exact) was responsible for 7.83% of the whole runtime (very tight loop), and I simply take whole metadata into account, so that additional processing is not needed.