Class ISOMsgCounter
java.lang.Object
org.jpos.metrics.iso.ISOMsgCounter
- All Implemented Interfaces:
Configurable, ISOMsgMetrics, LogSource
-
Nested Class Summary
Nested classes/interfaces inherited from interface ISOMsgMetrics
ISOMsgMetrics.Source -
Field Summary
Fields inherited from interface ISOMsgMetrics
DEFAULT_CHANNEL_FIELDS, DEFAULT_CHANNEL_METRIC_NAME, DEFAULT_TAGS, ENV_CHANNEL_FIELDS, ENV_CHANNEL_TAGS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.micrometer.core.instrument.TagsaddTags(io.micrometer.core.instrument.Tags tags) protected Set<io.micrometer.core.instrument.Meter> returns a clone set, which may not be up to date next time you use itA 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 fromISOMsgMetrics.getMetricName()andISOMsgMetrics.getTags().getRealm()io.micrometer.core.instrument.MeterRegistryio.micrometer.core.instrument.TagsgetTags()parseTagPairs(String tp, boolean copySingleTag) 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 toISOMsgMetrics.recordMessage(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.voidprotected StringresolveValExpr(ISOMsg m, String val) Hook for subclasses to resolve, against an ISOMsg, the valexpr part of a tag:valexpr in a fieldset.voidvoidvoidsetMetricDescription(String metricDescription) voidsetMetricName(String metricName) voidIt callsISOMsgMetrics.removeMeters()and clears its internal reference to itsMeterRegistry.
It will also "unfreeze" the object, making it available for reconfiguration.protected voidvalidateFieldSetMap(Map<String, String> fieldsMap) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ISOMsgMetrics
addTags
-
Constructor Details
-
ISOMsgCounter
- Throws:
ConfigurationException
-
-
Method Details
-
getMetricSignature
Description copied from interface:ISOMsgMetricsA 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 fromISOMsgMetrics.getMetricName()andISOMsgMetrics.getTags(). 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 byISOMsgMetrics.getTags().- Specified by:
getMetricSignaturein interfaceISOMsgMetrics- Returns:
- This overrides the default implementation, also including the keys from the internal field set.
-
getMetricName
- Specified by:
getMetricNamein interfaceISOMsgMetrics
-
setMetricName
- Specified by:
setMetricNamein interfaceISOMsgMetrics
-
getMetricDescription
- Specified by:
getMetricDescriptionin interfaceISOMsgMetrics
-
setMetricDescription
- Specified by:
setMetricDescriptionin interfaceISOMsgMetrics
-
addTags
- Specified by:
addTagsin interfaceISOMsgMetrics
-
getTags
- Specified by:
getTagsin interfaceISOMsgMetrics
-
recordMessage
Description copied from interface:ISOMsgMetricsRecords 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.- Specified by:
recordMessagein interfaceISOMsgMetrics- Parameters:
m- theISOMsgto record.
-
recordMessage
Description copied from interface:ISOMsgMetricsRecords anISOMsgin the meter registry.
Similar toISOMsgMetrics.recordMessage(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.- Specified by:
recordMessagein interfaceISOMsgMetrics- Parameters:
m- theISOMsgto record.
-
register
Description copied from interface:ISOMsgMetricsRegister 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 callingISOMsgMetrics.getRegistry()) - Before this object has been registered, it can be configured by setting tags, etc.,
but attempting to record a message (e.g. through
ISOMsgMetrics.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
ISOMsgMetrics.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.
ISOMsgMetrics.unregister()method should be called when done using this object.- Specified by:
registerin interfaceISOMsgMetrics- Returns:
- true if successful, false if there was an error having this registered
- Assign a
-
unregister
Description copied from interface:ISOMsgMetricsIt callsISOMsgMetrics.removeMeters()and clears its internal reference to itsMeterRegistry.
It will also "unfreeze" the object, making it available for reconfiguration.- Specified by:
unregisterin interfaceISOMsgMetrics
-
getRegistry
- Specified by:
getRegistryin interfaceISOMsgMetrics
-
removeMeters
- Specified by:
removeMetersin interfaceISOMsgMetrics
-
setConfiguration
- Specified by:
setConfigurationin interfaceConfigurable- Parameters:
cfg- Configuration object- Throws:
ConfigurationException
-
parseTagPairs
-
validateFieldSetMap
- Throws:
ConfigurationException
-
getMeters
-
getFieldSet
-
getTagsAsMap
-
resolveValExpr
Hook for subclasses to resolve, against an ISOMsg, the valexpr part of a tag:valexpr in a fieldset.
A subclass may add or override its own aliases, or have a special way to convert "valexpr" to a String taken from the given ISOMsg.
If the subclass can't resolve the alias/valexpr, it may call super (i.e. this method) as a fallback. -
setLogger
-
getRealm
-
getLogger
-