public interface MonitoringDataCollector
MonitoringDataSource
.Modifier and Type | Method and Description |
---|---|
default MonitoringDataCollector |
app(CharSequence appName) |
default MonitoringDataCollector |
collect(CharSequence key,
boolean value)
Similar to
collect(CharSequence, long) , true becomes 1L, false zero. |
default MonitoringDataCollector |
collect(CharSequence key,
Boolean value)
Ignores
null , otherwise collects using collect(CharSequence, boolean) . |
default MonitoringDataCollector |
collect(CharSequence key,
char value)
Similar to
collect(CharSequence, long) , the char simply becomes a number |
default MonitoringDataCollector |
collect(CharSequence key,
double value)
Similar to
collect(CharSequence, long) . |
default MonitoringDataCollector |
collect(CharSequence key,
Instant value)
Same as calling
collect(CharSequence, long) with a non null value and Instant.toEpochMilli() . |
MonitoringDataCollector |
collect(CharSequence key,
long value)
Collect a single metric data point (within the current context of tags of this collector).
|
default MonitoringDataCollector |
collect(CharSequence key,
Number value)
Ignores
null , collects Double and Float using
collect(CharSequence, double) , others using collect(CharSequence, long) . |
default <K,V> MonitoringDataCollector |
collectAll(Map<K,V> entries,
BiConsumer<MonitoringDataCollector,V> collect) |
default MonitoringDataCollector |
collectNonZero(CharSequence key,
long value)
Same as
collect(CharSequence, long) except that zero value are ignored and not collected. |
default <V> MonitoringDataCollector |
collectObject(V obj,
BiConsumer<MonitoringDataCollector,V> collect)
Same as calling
BiConsumer.accept(Object, Object) with this collector and the passed object. |
default <V> MonitoringDataCollector |
collectObject(V obj,
Class<V> as) |
default <V> MonitoringDataCollector |
collectObjects(Collection<V> entries,
BiConsumer<MonitoringDataCollector,V> collect)
Collects data points using the passed
BiConsumer for every entry if the passed Collection . |
default MonitoringDataCollector |
entity(CharSequence entity)
The entity tag states the identity that distinguishes values of one entry from another within the same collection
of entries.
|
default MonitoringDataCollector |
in(CharSequence namespace)
Namespaces are used to distinguish data points of different origin.
|
MonitoringDataCollector |
tag(CharSequence name,
CharSequence value)
Creates a collector with an extended context.
|
default MonitoringDataCollector |
type(CharSequence type)
The type tag states the type of a collected entry.
|
MonitoringDataCollector collect(CharSequence key, long value)
key
- the plain (context free) name of the metric (e.g. "size")value
- the current value of the metricMonitoringDataCollector tag(CharSequence name, CharSequence value)
name
- name of the type of contextvalue
- identifier within the context type, if null
or empty the tag is ignoreddefault MonitoringDataCollector collectNonZero(CharSequence key, long value)
collect(CharSequence, long)
except that zero value are ignored and not collected.default MonitoringDataCollector collect(CharSequence key, double value)
collect(CharSequence, long)
. Double values are converted to long by multiplying with 10K
effectively offering a precision of 4 fraction digits when converting back to FP number later on.default MonitoringDataCollector collect(CharSequence key, boolean value)
collect(CharSequence, long)
, true becomes 1L, false zero.default MonitoringDataCollector collect(CharSequence key, char value)
collect(CharSequence, long)
, the char simply becomes a numberdefault MonitoringDataCollector collect(CharSequence key, Number value)
null
, collects Double
and Float
using
collect(CharSequence, double)
, others using collect(CharSequence, long)
.default MonitoringDataCollector collect(CharSequence key, Boolean value)
null
, otherwise collects using collect(CharSequence, boolean)
.default MonitoringDataCollector collect(CharSequence key, Instant value)
collect(CharSequence, long)
with a non null value and Instant.toEpochMilli()
.default <V> MonitoringDataCollector collectObject(V obj, BiConsumer<MonitoringDataCollector,V> collect)
BiConsumer.accept(Object, Object)
with this collector and the passed object.default <V> MonitoringDataCollector collectObjects(Collection<V> entries, BiConsumer<MonitoringDataCollector,V> collect)
BiConsumer
for every entry if the passed Collection
.
The context is not changedentries
- null
or empty Collection
s are ignoredcollect
- the function collecting the individual data pointsdefault <K,V> MonitoringDataCollector collectAll(Map<K,V> entries, BiConsumer<MonitoringDataCollector,V> collect)
default <V> MonitoringDataCollector collectObject(V obj, Class<V> as)
default MonitoringDataCollector app(CharSequence appName)
default MonitoringDataCollector in(CharSequence namespace)
namespace
- the namespace to use, e.g. "health-monitor"default MonitoringDataCollector type(CharSequence type)
type
- type of entity or collection of entities that are about to be collecteddefault MonitoringDataCollector entity(CharSequence entity)
entity
- the entity to use, e.g. "log-notifier" (as opposed to "teams-notifier")Copyright © 2019. All rights reserved.