mirror of
https://github.com/google/nomulus
synced 2026-09-13 11:34:31 +00:00
Add method to create and register EventMetrics
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=132346375
This commit is contained in:
@@ -103,6 +103,33 @@ public interface MetricRegistry {
|
||||
String valueDisplayName,
|
||||
ImmutableSet<LabelDescriptor> labels);
|
||||
|
||||
/**
|
||||
* Returns a new {@link EventMetric}.
|
||||
*
|
||||
* <p>This metric type is intended for recording aspects of an "event" -- things like latency or
|
||||
* payload size.
|
||||
*
|
||||
* <p>The metric's values are {@link Distribution} instances which are updated via {@link
|
||||
* EventMetric#record(double, String...)}.
|
||||
*
|
||||
* <p>The metric is thread-safe. The metric will be registered at the time of creation and
|
||||
* collected for subsequent write intervals.
|
||||
*
|
||||
* @param name name of the metric. Should be in the form of '/foo/bar'.
|
||||
* @param description human readable description of the metric.
|
||||
* @param valueDisplayName human readable description of the metric's value type.
|
||||
* @param labels list of the metric's labels.
|
||||
* @param distributionFitter fit to apply to the underlying {@link Distribution} instances of this
|
||||
* metric.
|
||||
* @throws IllegalStateException if a metric of the same name is already registered.
|
||||
*/
|
||||
EventMetric newEventMetric(
|
||||
String name,
|
||||
String description,
|
||||
String valueDisplayName,
|
||||
ImmutableSet<LabelDescriptor> labels,
|
||||
DistributionFitter distributionFitter);
|
||||
|
||||
/**
|
||||
* Fetches a snapshot of the currently registered metrics
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user