ID | IEP-114 |
Author | |
Sponsor | |
Created | |
Status | DRAFT |
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 interface 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);
void longMetric(String name, LongSupplier valueSupplier, @Nullable String description);
LongSupplier longMetric(String name, @Nullable String description);
void doubleMetric(String name, DoubleSupplier valueSupplier, @Nullable String description);
DoubleSupplier doubleMetric(String name, @Nullable String description);
void booleanMetric(String name, BooleanSupplier valueSupplier, @Nullable String description);
BooleanSupplier booleanMetric(String name, @Nullable String description);
<T> void objectMetric(String name, Class<T> valueType, Supplier<T> valueSupplier, @Nullable String description);
<T> Supplier<T> objectMetric(String name, Class<T> valueType, @Nullable String description);
}