Class LoggingMeterRegistry
java.lang.Object
io.micrometer.core.instrument.MeterRegistry
io.micrometer.core.instrument.push.PushMeterRegistry
io.micrometer.core.instrument.step.StepMeterRegistry
io.micrometer.core.instrument.logging.LoggingMeterRegistry
Logging
MeterRegistry
.- Since:
- 1.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class io.micrometer.core.instrument.MeterRegistry
MeterRegistry.Config, MeterRegistry.More
-
Field Summary
Fields inherited from class io.micrometer.core.instrument.MeterRegistry
clock
-
Constructor Summary
ConstructorDescriptionLoggingMeterRegistry
(LoggingRegistryConfig config, Clock clock) Constructor allowing a custom clock and configuration.LoggingMeterRegistry
(LoggingRegistryConfig config, Clock clock, Consumer<String> loggingSink) Constructor allowing a custom sink, clock and configuration.LoggingMeterRegistry
(Consumer<String> loggingSink) Constructor allowing custom sink instead of a defaultlog::info
. -
Method Summary
Modifier and TypeMethodDescriptionstatic LoggingMeterRegistry.Builder
builder
(LoggingRegistryConfig config) protected TimeUnit
protected DistributionSummary
newDistributionSummary
(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, double scale) Build a new distribution summary to be added to the registry.protected Timer
newTimer
(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, PauseDetector pauseDetector) Build a new timer to be added to the registry.protected void
publish()
Methods inherited from class io.micrometer.core.instrument.step.StepMeterRegistry
close, defaultHistogramConfig, newCounter, newFunctionCounter, newFunctionTimer, newGauge, newLongTaskTimer, newMeter, start, stop
Methods inherited from class io.micrometer.core.instrument.push.PushMeterRegistry
getLastScheduledPublishStartTime, isPublishing, start, waitForInProgressScheduledPublish
Methods inherited from class io.micrometer.core.instrument.MeterRegistry
clear, config, counter, counter, find, forEachMeter, gauge, gauge, gauge, gauge, gaugeCollectionSize, gaugeMapSize, get, getConventionName, getConventionTags, getMeters, isClosed, meterRegistrationFailed, more, newLongTaskTimer, newTimeGauge, remove, remove, removeByPreFilterId, summary, summary, timer, timer
-
Constructor Details
-
LoggingMeterRegistry
public LoggingMeterRegistry() -
LoggingMeterRegistry
Constructor allowing a custom clock and configuration.- Parameters:
config
- the LoggingRegistryConfigclock
- the Clock
-
LoggingMeterRegistry
Constructor allowing custom sink instead of a defaultlog::info
.- Parameters:
loggingSink
- the custom sink that will be called for each time series.- Since:
- 1.11.0
-
LoggingMeterRegistry
public LoggingMeterRegistry(LoggingRegistryConfig config, Clock clock, Consumer<String> loggingSink) Constructor allowing a custom sink, clock and configuration.- Parameters:
config
- the LoggingRegistryConfigclock
- the ClockloggingSink
- the custom sink that will be called for each time series.- Since:
- 1.11.0
-
-
Method Details
-
publish
protected void publish()- Specified by:
publish
in classPushMeterRegistry
-
newTimer
protected Timer newTimer(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, PauseDetector pauseDetector) Description copied from class:MeterRegistry
Build a new timer to be added to the registry. This is guaranteed to only be called if the timer doesn't already exist.- Overrides:
newTimer
in classStepMeterRegistry
- Parameters:
id
- The id that uniquely identifies the timer.distributionStatisticConfig
- Configuration for published distribution statistics.pauseDetector
- The pause detector to use for coordinated omission compensation.- Returns:
- A new timer.
-
newDistributionSummary
protected DistributionSummary newDistributionSummary(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, double scale) Description copied from class:MeterRegistry
Build a new distribution summary to be added to the registry. This is guaranteed to only be called if the distribution summary doesn't already exist.- Overrides:
newDistributionSummary
in classStepMeterRegistry
- Parameters:
id
- The id that uniquely identifies the distribution summary.distributionStatisticConfig
- Configuration for published distribution statistics.scale
- Multiply every recorded sample by this factor.- Returns:
- A new distribution summary.
-
getBaseTimeUnit
- Specified by:
getBaseTimeUnit
in classMeterRegistry
- Returns:
- the registry's base TimeUnit. Must not be null.
-
builder
-