MINOR: Update the docs for Metrics (#20094)
CI / build (push) Waiting to run Details

Update the outdated Javadocs in Metrics.java. The `MetricName(String
name, String group)` constructor in MetricName.java was removed in

59b918ec2b
Minor typo fixes included.

Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi
 <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Jhen-Yung Hsu 2025-07-04 02:01:29 +08:00 committed by GitHub
parent 2e3ddb22ae
commit 4e31e270ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ import java.util.Map;
import java.util.Objects;
/**
* The <code>MetricName</code> class encapsulates a metric's name, logical group and its related attributes. It should be constructed using metrics.MetricName(...).
* The <code>MetricName</code> class encapsulates a metric's name, logical group and its related attributes. It should be constructed using metrics.metricName(...).
* <p>
* This class captures the following parameters:
* <pre>

View File

@ -48,7 +48,7 @@ import static java.util.Collections.emptyList;
* A registry of sensors and metrics.
* <p>
* A metric is a named, numerical measurement. A sensor is a handle to record numerical measurements as they occur. Each
* Sensor has zero or more associated metrics. For example a Sensor might represent message sizes and we might associate
* Sensor has zero or more associated metrics. For example, a Sensor might represent message sizes, and we might associate
* with this sensor a metric for the average, maximum, or other statistics computed off the sequence of message sizes
* that are recorded by the sensor.
* <p>
@ -58,9 +58,9 @@ import static java.util.Collections.emptyList;
* // set up metrics:
* Metrics metrics = new Metrics(); // this is the global repository of metrics and sensors
* Sensor sensor = metrics.sensor(&quot;message-sizes&quot;);
* MetricName metricName = new MetricName(&quot;message-size-avg&quot;, &quot;producer-metrics&quot;);
* MetricName metricName = metrics.metricName(&quot;message-size-avg&quot;, &quot;producer-metrics&quot;);
* sensor.add(metricName, new Avg());
* metricName = new MetricName(&quot;message-size-max&quot;, &quot;producer-metrics&quot;);
* metricName = metrics.metricName(&quot;message-size-max&quot;, &quot;producer-metrics&quot;);
* sensor.add(metricName, new Max());
*
* // as messages are sent we record the sizes