java.lang.Object
io.helidon.metrics.api.Metrics
A main entry point for developers to the Helidon metrics system, allowing access to the global meter registry and providing
shortcut methods to register and locate meters in the global registry and remove meters from it.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceThe annotated method will be counted.static @interfaceThe annotated method will be a gauge source.static @interfaceMetric tag.static @interfaceContainer forMetrics.Tagrepeating annotation.static @interfaceThe annotated method will be timed. -
Method Summary
Modifier and TypeMethodDescriptionstatic MeterRegistryDeprecated, for removal: This API element is subject to removal in a future version.static MeterRegistrycreateMeterRegistry(MetricsConfig metricsConfig) Deprecated, for removal: This API element is subject to removal in a future version.useMeterRegistry.create(MetricsConfig)insteadDeprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementgetCounter(String name) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementgetCounter(String name, Iterable<Tag> tags) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementDeprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementDeprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementstatic <M extends Meter,B extends Meter.Builder<B, M>>
MgetOrCreate(B builder) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementstatic Optional<DistributionSummary> getSummary(String name) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementstatic Optional<DistributionSummary> getSummary(String name, Iterable<Tag> tags) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementDeprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementDeprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementstatic MeterRegistryDeprecated, for removal: This API element is subject to removal in a future version.global instances are deprecated in general, andServicescan be used to get such an instance; until these methods are removed, the behavior may differstatic TagDeprecated, for removal: This API element is subject to removal in a future version.useTag.create(String, String)insteadDeprecated, for removal: This API element is subject to removal in a future version.useTag.create(String, String)instead
-
Method Details
-
globalRegistry
Deprecated, for removal: This API element is subject to removal in a future version.global instances are deprecated in general, andServicescan be used to get such an instance; until these methods are removed, the behavior may differReturns the global meter registry.- Returns:
- the global meter registry
-
createMeterRegistry
@Deprecated(since="4.4.0", forRemoval=true) public static MeterRegistry createMeterRegistry(MetricsConfig metricsConfig) Deprecated, for removal: This API element is subject to removal in a future version.useMeterRegistry.create(MetricsConfig)insteadCreates a meter registry, not saved as the global registry, based on the provided metrics config.- Parameters:
metricsConfig- metrics config- Returns:
- new meter registry
-
createMeterRegistry
Deprecated, for removal: This API element is subject to removal in a future version.useMeterRegistry.create()insteadCreates a meter registry, not saved as the global registry, using default metrics config information based on global config.- Returns:
- new meter registry
-
getOrCreate
@Deprecated(since="4.4.0", forRemoval=true) public static <M extends Meter,B extends Meter.Builder<B, M getOrCreateM>> (B builder) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementLocates a previously-registered meter using the name and tags in the provided builder or, if not found, registers a new one using the provided builder, both using the metrics factory's global registry.- Type Parameters:
M- type of the meterB- builder for the meter- Parameters:
builder- builder to use in finding or creating a meter- Returns:
- the previously-registered meter with the same name and tags or, if none, the newly-registered one
-
getCounter
@Deprecated(since="4.4.0", forRemoval=true) public static Optional<Counter> getCounter(String name, Iterable<Tag> tags) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementLocates a previously-registered counter.- Parameters:
name- name to matchtags- tags to match- Returns:
Optionalof the previously-registered counter; empty if not found
-
getCounter
Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementLocates a previously-registerec counter.- Parameters:
name- name to match- Returns:
Optionalof the previously-registered counter; empty if not found
-
getSummary
@Deprecated(since="4.4.0", forRemoval=true) public static Optional<DistributionSummary> getSummary(String name, Iterable<Tag> tags) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementLocates a previously-registered distribution summary.- Parameters:
name- name to matchtags- tags to match- Returns:
Optionalof the previously-registered distribution summary; empty if not found
-
getSummary
@Deprecated(since="4.4.0", forRemoval=true) public static Optional<DistributionSummary> getSummary(String name) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementLocates a previously-registered distribution summary.- Parameters:
name- name to match- Returns:
Optionalof the previously-registered distribution summary; empty if not found
-
getGauge
@Deprecated(since="4.4.0", forRemoval=true) public static Optional<Gauge> getGauge(String name, Iterable<Tag> tags) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementLocates a previously-registered gauge.- Parameters:
name- name to matchtags- tags to match- Returns:
Optionalof the previously-registered gauge; empty if not found
-
getGauge
Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementLocates a previously-registered gauge.- Parameters:
name- name to match- Returns:
Optionalof the previously-registered gauge; empty if not found
-
getTimer
@Deprecated(since="4.4.0", forRemoval=true) public static Optional<Timer> getTimer(String name, Iterable<Tag> tags) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementLocates a previously-registered timer.- Parameters:
name- name to matchtags- tags to match- Returns:
Optionalof the previously-registered timer; empty if not found
-
getTimer
Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementLocates a previously-registered timer.- Parameters:
name- name to match- Returns:
Optionalof the previously-registered timer; empty if not found
-
get
@Deprecated(since="4.4.0", forRemoval=true) public static <M extends Meter> Optional<M> get(Class<M> mClass, String name, Iterable<Tag> tags) Deprecated, for removal: This API element is subject to removal in a future version.use theMeterRegistryAPI instead, as this method is just a shortcut toglobalRegistry(); this method will be removed without a replacementLocates a previously-registered meter of the specified type, matching the name and tags.The method throws an
IllegalArgumentExceptionif a meter exists with the name and tags but is not type-compatible with the provided class.- Type Parameters:
M- type of the meter to find- Parameters:
mClass- type of the meter to findname- name to matchtags- tags to match- Returns:
Optionalof the previously-regsitered meter; empty if not found
-
tag
Deprecated, for removal: This API element is subject to removal in a future version.useTag.create(String, String)insteadCreates aTagfor the specified key and value.- Parameters:
key- tag keyvalue- tag value- Returns:
- new tag
-
tags
@Deprecated(since="4.4.0", forRemoval=true) public static Iterable<Tag> tags(String... keyValuePairs) Deprecated, for removal: This API element is subject to removal in a future version.useTag.create(String, String)instead- Parameters:
keyValuePairs- pairs of tag name/tag value pairs- Returns:
- tags corresponding to the tag name/tag value pairs
-
MeterRegistry.create()instead