...
/**
* Adds a long value custom metric.
*
* @return New or previously registered long value metric. {@code Null} if previous metric is not a {@link LongConsumer}.
*/
@Nullable LongConsumer longMetric(String registryName, String metricName, @Nullable String description);
/**
* Adds a double value custom metric.
*
* @return New or previously registered long value metric. {@code Null} if previous metric is not a {@link DoubleConsumer}.
*/
@Nullable DoubleConsumer doubleMetric(String registryName, String metricName, @Nullable String description);
/**
* Adds a int value custom metric.
*
* @return New or previously registered long value metric. {@code Null} if previous metric is not an {@link IntConsumer}.
*/
@Nullable IntConsumer booleanMetric(String registryName, String metricName, @Nullable String description);
/**
* Adds a long value custom metric.
*
* @return {@code True} if {@code supplier} has been registered as a new int metric. {@code False}, if a previous
* value supplier already exists.
*/
boolean longMetric(String registryName, String metricName, LongSupplier supplier, @Nullable String description);
/**
* Adds a double value custom metric.
*
* @return {@code True} if {@code supplier} has been registered as a new int metric. {@code False}, if a previous
* value supplier already exists.
*/
boolean doubleMetric(String registryName, String metricName, DoubleSupplier supplier, @Nullable String description);
/**
* Adds a int value custom metric.
*
* @return {@code True} if {@code supplier} has been registered as a new int metric. {@code False}, if a previous
* value supplier already exists.
*/
boolean intMetric(String registryName, String metricName, BooleanSupplier supplier, @Nullable String description);
/** Removes certain custom metric. */
void removeCustomMetric(String registryName, String metricName);
/** Removes entire custom metric registry. */
void removeCustomRegistry(String registryName);
/** Provides custom or internal read-only metric registry. */
@Nullable ReadOnlyMetricRegistry findRegistry(String registryName);
}
...
Expand | ||
---|---|---|
| ||
/** */ // Registers metric "custom.service.svc.filteredInvocation" ignite.metrics().customRegistry(regName(ctx.name())).gauge("filteredInvocation", metricValue::get, "Counter of speceific service invocation."); // Registers metric "custom.service.svc.loaded" // Registers metric "custom.service.svc.remote.classId" |
Expand | ||
---|---|---|
| ||
/** */ // Registers metric "custom.task.test.current" LongValueMetric metricCur = ignite.metrics().customRegistry("task.test").longMetric("current", null); // Registers metric "custom.task.test.total.sum" LongSumMetric metricTotal = ignite.metrics().customRegistry("task.test").longAdderMetric("total.sum", null); // Registers metric "custom.task.test.ticks" LongSumMetric metricTicks = ignite.metrics().customRegistry("task.test").longAdderMetric("ticks", null); } |
We already have implementations of more complex and useful metrics. We could also store custom metrics. Thus, the development stages might be:
...