public interface MonitoringDataCollector
MonitoringDataSource.| Modifier and Type | Method and Description |
|---|---|
MonitoringDataCollector |
annotate(CharSequence metric,
long value,
boolean keyed,
String... attrs)
Adds an annotation entry for the given metric with an individual value that can differ from collected value at
same point in time in case the collected value represents an aggregate while the annotated value is specific for
the annotation instance.
|
default MonitoringDataCollector |
annotate(CharSequence metric,
long value,
String... attrs)
|
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 metric,
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 <K,V> MonitoringDataCollector |
collectAll(Map<K,V> entries,
Function<K,CharSequence> entryTag,
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 |
group(CharSequence type)
The type tag states the type of a collected entry.
|
default MonitoringDataCollector |
in(CharSequence namespace)
Namespaces are used to distinguish data points of different origin.
|
default MonitoringDataCollector |
prefix(CharSequence prefix) |
MonitoringDataCollector |
tag(CharSequence name,
CharSequence value)
Creates a collector with an extended context.
|
MonitoringDataCollector tag(CharSequence name, CharSequence value)
name - name of the type of contextvalue - identifier within the context type, if null or empty the tag is ignoredMonitoringDataCollector collect(CharSequence metric, long value)
metric - the plain (context free) name of the metric (e.g. "Size")value - the current value of the metricMonitoringDataCollector annotate(CharSequence metric, long value, boolean keyed, String... attrs)
metric - name of the metric the annotation relates tovalue - value for the annotation instance, usually identical to current collected value but
potentially different in case of multiple instances that were aggregated to current collected
value.keyed - true, if the first attribute value given refers to the key used to identify duplicate
annotations, else false. Annotations for same key replace each other.attrs - a sequence of key-value pairs the value is annotated with.
For example: ["name", "Foo", "age", "7"]default MonitoringDataCollector annotate(CharSequence metric, long value, String... attrs)
default MonitoringDataCollector prefix(CharSequence prefix)
default 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 Collections are ignoredcollect - the function collecting the individual data pointsdefault <K,V> MonitoringDataCollector collectAll(Map<K,V> entries, BiConsumer<MonitoringDataCollector,V> collect)
default <K,V> MonitoringDataCollector collectAll(Map<K,V> entries, Function<K,CharSequence> entryTag, BiConsumer<MonitoringDataCollector,V> collect)
default <V> MonitoringDataCollector collectObject(V obj, Class<V> as)
default MonitoringDataCollector in(CharSequence namespace)
namespace - the namespace to use, e.g. "health-monitor"default MonitoringDataCollector group(CharSequence type)
type - type of entity or collection of entities that are about to be collectedCopyright © 2020. All rights reserved.