...
ID | IEP-114 | ||||||||
Author | |||||||||
Sponsor | |||||||||
Created | |||||||||
Status |
|
Table of Contents |
---|
It is useful for user to work with own metrics, not only with provided by Ignite. Current public metrics API doesn't expose any method to add or delete additional metrics. We should allow user to register custom metrics.
The most important reason to provide custom is probably the convenience of collecting of desired metrics using one platform, the same client, through the same API. This feature can simplify user application.
Oracle DB , Postgres , Oracle Coherence , MS SQL Server , IBM DB2
GridMetricManager handles the custom metrics.
package org.apache.ignite;
...
public IgniteMetrics metrics();
}
package org.apache.ignite;
public interface IgniteMetrics {
<T extends Metric> T metric(T metric);
@Nullable <T extends Metric> T metric(String name);
void removeMetric(String name);
ReadOnlyMetricRegistry registry(String name);
LongMetric longMetric(String name, LongSupplier valueSupplier, @Nullable String description);
LongSupplier longMetric(String name, @Nullable String description);
DoubleMetric doubleMetric(String name, DoubleSupplier valueSupplier, @Nullable String description);
DoubleSupplier doubleMetric(String name, @Nullable String description);
BooleanMetric booleanMetric(String name, BooleanSupplier valueSupplier, @Nullable String description);
BooleanSupplier booleanMetric(String name, @Nullable String description);
<T> ObjectMetric<T> objectMetric(String name, Class<T> valueType, Supplier<T> valueSupplier, @Nullable String description);
<T> Supplier<T> objectMetric(String name, Class<T> valueType, @Nullable String description);
}