public class FlinkMetricGroup extends Object implements MetricGroup
MetricGroup
which wraps a Flink's MetricGroup
and
register all metrics into Flink's metric system.Constructor and Description |
---|
FlinkMetricGroup(org.apache.flink.metrics.MetricGroup wrapped,
String groupName,
Map<String,String> variables) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the metric group and release related resources.
|
Counter |
counter(String name)
Creates and registers a new
Counter with Paimon. |
<T> Gauge<T> |
gauge(String name,
Gauge<T> gauge)
Registers a new
Gauge with Paimon. |
Map<String,String> |
getAllVariables()
Returns a map of all variables and their associated value.
|
String |
getGroupName()
Returns the name for this group, meaning what kind of entity it represents, for example
"commit".
|
Map<String,Metric> |
getMetrics()
Returns all the metrics the group carries.
|
Histogram |
histogram(String name,
int windowSize)
Registers a new
Histogram with Paimon. |
public Counter counter(String name)
MetricGroup
Counter
with Paimon.counter
in interface MetricGroup
name
- name of the counterpublic <T> Gauge<T> gauge(String name, Gauge<T> gauge)
MetricGroup
Gauge
with Paimon.gauge
in interface MetricGroup
T
- return type of the gaugename
- name of the gaugegauge
- gauge to registerpublic Histogram histogram(String name, int windowSize)
MetricGroup
Histogram
with Paimon.histogram
in interface MetricGroup
name
- name of the histogramwindowSize
- number of records this histogram keepspublic Map<String,String> getAllVariables()
MetricGroup
getAllVariables
in interface MetricGroup
public String getGroupName()
MetricGroup
getGroupName
in interface MetricGroup
public Map<String,Metric> getMetrics()
MetricGroup
getMetrics
in interface MetricGroup
public void close()
MetricGroup
close
in interface MetricGroup
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.