Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document max for Timer and DistributionSummary #101

Merged
merged 4 commits into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/docs/concepts/distribution-summaries.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ DistributionSummary summary = DistributionSummary
1. Add base units for maximum portability -- base units are part of the naming convention for some monitoring systems. Leaving it off and violating the naming convention will have no adverse effect if you forget.
2. Optionally, you may provide a scaling factor that each recorded sample will be multipled by as it is recorded.
NOTE: Max for basic `DistributionSummary` implementations such as `CumulativeDistributionSummary`, `StepDistributionSummary` is a time window max (`TimeWindowMax`).
It means that its value is the maximum value during a time window.
If no new values are recorded for the time window length, the max will be reset to 0 as a new time window starts.
Time window size will be the step size of the meter registry unless expiry in `DistributionStatisticConfig` is set to other value explicitly.

== Scaling and histograms

Micrometer's preselected percentile histogram buckets are all integers from 1 to maximum long. Currently `minimumExpectedValue` and `maximumExpectedValue` serve to control the cardinality of the bucket set. If we attempt to detect that your min/max yields a small range and scale the preselected bucket domain to your summary's range, then we don't have another lever to control bucket cardinality.
Expand Down
5 changes: 5 additions & 0 deletions src/docs/concepts/timers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Timer timer = Timer
.register(registry);
----

NOTE: Max for basic `Timer` implementations such as `CumulativeTimer`, `StepTimer` is a time window max (`TimeWindowMax`).
It means that its value is the maximum value during a time window.
If no new values are recorded for the time window length, the max will be reset to 0 as a new time window starts.
Time window size will be the step size of the meter registry unless expiry in `DistributionStatisticConfig` is set to other value explicitly.

== Recording blocks of code

The `Timer` interface exposes several convenience overloads for recording timings inline, e.g.:
Expand Down