Caffeine instrumentation: add weighted size metric #1251
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are two modifications in this PR:
caffeine_cache_eviction_weight
has been changed from agauge
to acounter
- that seems semantically more pertinent to me, as that statistic can only increase (though there is a debate on that point - see Add weighted size counter to caffeine instrumentation #1246);caffeine_cache_weighted_size
has been added;There are at least two backwards compatibility concerns that should be given a thought:
caffeine_cache_eviction_weight
is accepted, users would have to migrate to using the_total
suffix;caffeine-instrumentation
, and has defined their owncaffeine_cache_weighted_size
metric, upgrading to a version that includes this PR would break their application;Point 1 obviously depends on whether the type change is accepted, both from a theoretical point of view (how it should be modelled as a metric), and from a practical point of view (is the change worth a migration for current users).
For point 2, I guess my main point would be to understand the project's policy on backward compatibility when adding metric names in instrumentation libraries. I would be happy to add documentation pertaining to: