public interface 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.
- 
Method SummaryStatic MethodsModifier and TypeMethodDescriptionstatic MeterRegistryCreates a meter registry, not saved as the global registry, using default metrics config information based on global config.static MeterRegistrycreateMeterRegistry(MetricsConfig metricsConfig) Creates a meter registry, not saved as the global registry, based on the provided metrics config.Locates a previously-registered meter of the specified type, matching the name and tags.getCounter(String name) Locates a previously-registerec counter.getCounter(String name, Iterable<Tag> tags) Locates a previously-registered counter.Locates a previously-registered gauge.Locates a previously-registered gauge.static <M extends Meter,B extends Meter.Builder<B, M>> 
 MgetOrCreate(B builder) Locates 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.static Optional<DistributionSummary> getSummary(String name) Locates a previously-registered distribution summary.static Optional<DistributionSummary> getSummary(String name, Iterable<Tag> tags) Locates a previously-registered distribution summary.Locates a previously-registered timer.Locates a previously-registered timer.static MeterRegistryReturns the global meter registry.static TagCreates aTagfor the specified key and value.
- 
Method Details- 
globalRegistryReturns the global meter registry.- Returns:
- the global meter registry
 
- 
createMeterRegistryCreates a meter registry, not saved as the global registry, based on the provided metrics config.- Parameters:
- metricsConfig- metrics config
- Returns:
- new meter registry
 
- 
createMeterRegistryCreates a meter registry, not saved as the global registry, using default metrics config information based on global config.- Returns:
- new meter registry
 
- 
getOrCreateLocates 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 meter
- B- 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
 
- 
getCounterLocates a previously-registered counter.- Parameters:
- name- name to match
- tags- tags to match
- Returns:
- Optionalof the previously-registered counter; empty if not found
 
- 
getCounterLocates a previously-registerec counter.- Parameters:
- name- name to match
- Returns:
- Optionalof the previously-registered counter; empty if not found
 
- 
getSummaryLocates a previously-registered distribution summary.- Parameters:
- name- name to match
- tags- tags to match
- Returns:
- Optionalof the previously-registered distribution summary; empty if not found
 
- 
getSummaryLocates a previously-registered distribution summary.- Parameters:
- name- name to match
- Returns:
- Optionalof the previously-registered distribution summary; empty if not found
 
- 
getGaugeLocates a previously-registered gauge.- Parameters:
- name- name to match
- tags- tags to match
- Returns:
- Optionalof the previously-registered gauge; empty if not found
 
- 
getGaugeLocates a previously-registered gauge.- Parameters:
- name- name to match
- Returns:
- Optionalof the previously-registered gauge; empty if not found
 
- 
getTimerLocates a previously-registered timer.- Parameters:
- name- name to match
- tags- tags to match
- Returns:
- Optionalof the previously-registered timer; empty if not found
 
- 
getTimerLocates a previously-registered timer.- Parameters:
- name- name to match
- Returns:
- Optionalof the previously-registered timer; empty if not found
 
- 
getLocates 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 find
- name- name to match
- tags- tags to match
- Returns:
- Optionalof the previously-regsitered meter; empty if not found
 
- 
tagCreates aTagfor the specified key and value.- Parameters:
- key- tag key
- value- tag value
- Returns:
- new tag
 
- 
tags- Parameters:
- keyValuePairs- pairs of tag name/tag value pairs
- Returns:
- tags corresponding to the tag name/tag value pairs
 
 
-