@Public public interface MetricGroup
Metrics
and further metric subgroups.
Instances of this class can be used to register new metrics with Flink and to create a nested hierarchy based on the group names.
A MetricGroup is uniquely identified by it's place in the hierarchy and name.
Modifier and Type | Method and Description |
---|---|
default MetricGroup |
addGroup(int name)
Creates a new MetricGroup and adds it to this groups sub-groups.
|
MetricGroup |
addGroup(String name)
Creates a new MetricGroup and adds it to this groups sub-groups.
|
MetricGroup |
addGroup(String key,
String value)
Creates a new key-value MetricGroup pair.
|
default void |
addSpan(SpanBuilder spanBuilder) |
default Counter |
counter(int name)
Creates and registers a new
Counter with Flink. |
default <C extends Counter> |
counter(int name,
C counter)
Registers a
Counter with Flink. |
Counter |
counter(String name)
Creates and registers a new
Counter with Flink. |
<C extends Counter> |
counter(String name,
C counter)
Registers a
Counter with Flink. |
default <T,G extends Gauge<T>> |
gauge(int name,
G gauge)
Registers a new
Gauge with Flink. |
<T,G extends Gauge<T>> |
gauge(String name,
G gauge)
Registers a new
Gauge with Flink. |
Map<String,String> |
getAllVariables()
Returns a map of all variables and their associated value, for example
{"<host>"="host-7", "<tm_id>"="taskmanager-2"} . |
String |
getMetricIdentifier(String metricName)
Returns the fully qualified metric name, for example
"host-7.taskmanager-2.window_word_count.my-mapper.metricName" . |
String |
getMetricIdentifier(String metricName,
CharacterFilter filter)
Returns the fully qualified metric name, for example
"host-7.taskmanager-2.window_word_count.my-mapper.metricName" . |
String[] |
getScopeComponents()
Gets the scope as an array of the scope components, for example
["host-7",
"taskmanager-2", "window_word_count", "my-mapper"] . |
default <H extends Histogram> |
histogram(int name,
H histogram)
Registers a new
Histogram with Flink. |
<H extends Histogram> |
histogram(String name,
H histogram)
Registers a new
Histogram with Flink. |
default <M extends Meter> |
meter(int name,
M meter)
Registers a new
Meter with Flink. |
<M extends Meter> |
meter(String name,
M meter)
Registers a new
Meter with Flink. |
@Experimental default void addSpan(SpanBuilder spanBuilder)
default Counter counter(int name)
Counter
with Flink.name
- name of the counterCounter counter(String name)
Counter
with Flink.name
- name of the counterdefault <C extends Counter> C counter(int name, C counter)
Counter
with Flink.C
- counter typename
- name of the countercounter
- counter to register<C extends Counter> C counter(String name, C counter)
Counter
with Flink.C
- counter typename
- name of the countercounter
- counter to registerdefault <T,G extends Gauge<T>> G gauge(int name, G gauge)
Gauge
with Flink.T
- return type of the gaugename
- name of the gaugegauge
- gauge to register<T,G extends Gauge<T>> G gauge(String name, G gauge)
Gauge
with Flink.T
- return type of the gaugename
- name of the gaugegauge
- gauge to register<H extends Histogram> H histogram(String name, H histogram)
Histogram
with Flink.H
- histogram typename
- name of the histogramhistogram
- histogram to registerdefault <H extends Histogram> H histogram(int name, H histogram)
Histogram
with Flink.H
- histogram typename
- name of the histogramhistogram
- histogram to register<M extends Meter> M meter(String name, M meter)
Meter
with Flink.M
- meter typename
- name of the metermeter
- meter to registerdefault <M extends Meter> M meter(int name, M meter)
Meter
with Flink.M
- meter typename
- name of the metermeter
- meter to registerdefault MetricGroup addGroup(int name)
name
- name of the groupMetricGroup addGroup(String name)
name
- name of the groupMetricGroup addGroup(String key, String value)
The only difference between calling this method and group.addGroup(key).addGroup(value)
is that getAllVariables()
of the value group
return an additional "<key>"="value"
pair.
key
- name of the first groupvalue
- name of the second groupString[] getScopeComponents()
["host-7",
"taskmanager-2", "window_word_count", "my-mapper"]
.Map<String,String> getAllVariables()
{"<host>"="host-7", "<tm_id>"="taskmanager-2"}
.String getMetricIdentifier(String metricName)
"host-7.taskmanager-2.window_word_count.my-mapper.metricName"
.metricName
- metric nameString getMetricIdentifier(String metricName, CharacterFilter filter)
"host-7.taskmanager-2.window_word_count.my-mapper.metricName"
.metricName
- metric namefilter
- character filter which is applied to the scope components if not null.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.