THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
/**
* Custom metric manager. Allows to add own metrics in registers with names starting with "custom.".
*/
public interface IgniteMetrics {
/**
* Registers metric in register 'custom.' + {@code registryName}. Adds new register if absent.
*
* @return New {@code metric} or previous metric if it already exists with the same name.
*/
<T extends Metric> T metric(String registryName, String metricName, T metric);
/** Removes metric from register 'custom.' + {@code registryName}. */
void removeMetric(String registryName, String metricName);
/** @return Metric registry named '"custom." + {@code registryName}'. */
ReadOnlyMetricRegistry registry(String registryName);
/** @return Removes registry named '"custom." + {@code registryName}'. */
ReadOnlyMetricRegistryvoid removeRegistry(String registryName);
// Simple type metrics.
/**
* Registers a {@link LongMetric} in register 'custom.' + {@code registryName}. Adds registry if absent.
*
* @return New or previously registered long value setter.
*/
LongConsumer longMetric(String registryName, String metricName, @Nullable String description);
/**
* Registers a {@link DoubleMetric} in register 'custom.' + {@code registryName}. Adds registry if absent.
*
* @return New or previously registered double value setter.
*/
DoubleConsumer doubleMetric(String registryName, String metricName, @Nullable String description);
/**
* Registers a {@link BooleanMetric} in register 'custom.' + {@code registryName}. Adds registry if absent.
*
* @return New or previously registered boolean value setter.
*/
Consumer<Boolean> booleanMetric(String registryName, String metricName, @Nullable String description);
/**
* Registers a {@link ObjectMetric} in register 'custom.' + {@code registryName}. Adds registry if absent.
*
* @return New or previously registered object setter.
*/
<T> Consumer<T> objectMetric(String registryName, String metricName, Class<T> valueType, @Nullable String description);
// Might be useful the gauges:
/**
* Registers a {@link LongMetric} metric in register 'custom.' + {@code registryName} with long value supplier {@code valueSupplier}.
* Adds registry if absent.
*
* @return {@code True} if metric was added. {@code False} if another meric already exists under the same name.
*/
boolean longMetric(String registryName, String metricName, LongSupplier valueSupplier, @Nullable String description);
/**
* Registers a {@link DoubleMetric} metric in register 'custom.' + {@code registryName} with double value supplier {@code valueSupplier}.
* Adds registry if absent.
*
* @return {@code True} if metric was added. {@code False} if another meric already exists under the same name.
*/
boolean doubleMetric(String registryName, String metricName, DoubleSupplier valueSupplier, @Nullable String description);
/**
* Registers a {@link BooleanMetric} metric in register 'custom.' + {@code registryName} with boolean value supplier {@code valueSupplier}.
* Adds registry if absent.
*
* @return {@code True} if metric was added. {@code False} if another meric already exists under the same name.
*/
boolean booleanMetric(String registryName, String metricName, BooleanSupplier valueSupplier, @Nullable String description);
/**
* Registers a {@link ObjectMetric} metric in register 'custom.' + {@code registryName} with object value supplier {@code valueSupplier}.
* Adds registry if absent.
*
* @return {@code True} if metric was added. {@code False} if another meric already exists under the same name.
*/
<T> boolean objectMetric(String registryName, String metricName, Class<T> valueType, Supplier<T> valueSupplier, @Nullable String description);
}
...