...
<T extends Metric> T metric(T metric);
/** Removes custom metric named '"custom." + {@code name}'. */
void removeMetric(String name);
/** @return custom Metric registry named '"custom." + {@code name}'. */
ReadOnlyMetricRegistry registry(String name);
// Simple type metrics.
/** Registers LongMetric. */
LongConsumer longMetric(String name, @Nullable String description);
/** Registers DoubleMetric. */
DoubleConsumer doubleMetric(String name, @Nullable String description);
/** Registers BooleanMetric. */
Consumer<Boolean> booleanMetric(String name, @Nullable String description);
/** Registers ObjectMetric. */
<T> Consumer<T> objectMetric(String name, Class<T> valueType, @Nullable String description);
// Might be useful the gauges:
/** Registers DoubleGauge. */
void doubleMetric(String name, DoubleSupplier valueSupplier, @Nullable String description);
/** Registers BooleanGauge. */
void booleanMetric(String name, BooleanSupplier valueSupplier, @Nullable String description);
/** Registers ObjectGauge. */
<T> void objectMetric(String name, Class<T> valueType, Supplier<T> valueSupplier, @Nullable String description);
/** Registers LongGauge. */
void longMetric(String name, LongSupplier valueSupplier, @Nullable String description);
}
...