Interface ISOMsgMetrics
- All Known Implementing Classes:
ISOMsgCounter
public interface ISOMsgMetrics
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionio.micrometer.core.instrument.TagsaddTags(io.micrometer.core.instrument.Tags tags) default io.micrometer.core.instrument.Tagsdefault StringA unique meter signature, concatenating the meter name, vertical pipe, comma-separated sorted list of all tag keys that this object produces.
Default implementation uses the values fromgetMetricName()andgetTags().io.micrometer.core.instrument.MeterRegistrydefault io.micrometer.core.instrument.TagsgetTags()voidRecords anISOMsgin the meter registry.
The metric name and tags will be taken strictly from this object's configuration.voidrecordMessage(ISOMsg m, MeterInfo meterInfo) Records anISOMsgin the meter registry.
Similar torecordMessage(ISOMsg)but using the metric name, description and maybe some tags taken from theMeterInfoargument.booleanregister(io.micrometer.core.instrument.MeterRegistry registry) Register this object to work with a givenMeterRegistry. This method may serve more than one purpose in the object's lifecycle: Assign aMeterRegistryto be used for the created meters.voidvoidsetMetricDescription(String metricDescription) voidsetMetricName(String metricName) voidIt callsremoveMeters()and clears its internal reference to itsMeterRegistry.
It will also "unfreeze" the object, making it available for reconfiguration.
-
Field Details
-
DEFAULT_CHANNEL_METRIC_NAME
-
ENV_CHANNEL_TAGS
- See Also:
-
DEFAULT_TAGS
- See Also:
-
ENV_CHANNEL_FIELDS
- See Also:
-
DEFAULT_CHANNEL_FIELDS
- See Also:
-
-
Method Details
-
setMetricName
-
getMetricName
-
getMetricDescription
-
setMetricDescription
-
addTags
-
addTags
-
getTags
-
recordMessage
Records anISOMsgin the meter registry.
The metric name and tags will be taken strictly from this object's configuration.
If this object hasn't been successfully registered, it throws anIllegalStateException.- Parameters:
m- theISOMsgto record.- Throws:
IllegalStateException- when this object hasn't been registered
-
recordMessage
Records anISOMsgin the meter registry.
Similar torecordMessage(ISOMsg)but using the metric name, description and maybe some tags taken from theMeterInfoargument.If the metric for that combination of
MeterInfovalues and local values fails to register in the globalMeterRegistry(or any underlying one like the Prometheus registry), the method may throw anIllegalStateException. This also happens if this object hasn't been successfully registered by The metric name and tags will be taken from what has been configured. If this object hasn't been successfully registered, it throws anIllegalStateException.- Parameters:
m- theISOMsgto record.- Throws:
IllegalStateException- when this object hasn't been registered
-
register
Register this object to work with a givenMeterRegistry. This method may serve more than one purpose in the object's lifecycle:- Assign a
MeterRegistryto be used for the created meters. (The registry can be obtained by callinggetRegistry()) - Before this object has been registered, it can be configured by setting tags, etc.,
but attempting to record a message (e.g. through
recordMessage(ISOMsg)) will throw anIllegalStateException. - After it has been registered, it's ready to record messages.
However, it can't be configured any longer, or it will throw an
IllegalStateException. The object's configuration can be considered "frozen". - In some (future) implementation, it may make use of the
getMetricSignature()to do some caching to ensure that every metric name has only one set of tag keys, thus avoiding metrics name+keyset collision inPrometheusMeterRegistry.
unregister()method should be called when done using this object.- Returns:
- true if successful, false if there was an error having this registered
- Assign a
-
unregister
void unregister()It callsremoveMeters()and clears its internal reference to itsMeterRegistry.
It will also "unfreeze" the object, making it available for reconfiguration. -
getRegistry
io.micrometer.core.instrument.MeterRegistry getRegistry() -
removeMeters
void removeMeters() -
getMetricSignature
A unique meter signature, concatenating the meter name, vertical pipe, comma-separated sorted list of all tag keys that this object produces.
Default implementation uses the values fromgetMetricName()andgetTags(). A concrete implementation must make sure of gathering all the appropriate tag keys from internal config state which may include more than what's returned bygetTags().- Returns:
- The unique metric signature.
-