Skip to content

Commit

Permalink
[FLINK-25608][metrics] Annotate metrics classes with Public(Evolving)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Paul committed Jan 11, 2022
1 parent 29dd24f commit 549e1b1
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 17 deletions.

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion flink-metrics/flink-metrics-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ under the License.
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-annotations</artifactId>
<version>${project.version}</version>
</dependency>
<!-- ================== test dependencies ================== -->

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils-junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@

package org.apache.flink.metrics;

import org.apache.flink.annotation.Public;

/**
* Interface for a character filter function. The filter function is given a string which the filter
* can transform. The returned string is the transformation result.
*/
@Public
public interface CharacterFilter {
CharacterFilter NO_OP_FILTER = input -> input;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

package org.apache.flink.metrics;

import org.apache.flink.annotation.Public;

/** A Counter is a {@link Metric} that measures a count. */
@Public
public interface Counter extends Metric {

/** Increment the current count by 1. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

package org.apache.flink.metrics;

import org.apache.flink.annotation.Public;

/** A Gauge is a {@link Metric} that calculates a specific value at a point in time. */
@Public
public interface Gauge<T> extends Metric {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@

package org.apache.flink.metrics;

import org.apache.flink.annotation.Public;

/**
* Histogram interface to be used with Flink's metrics system.
*
* <p>The histogram allows to record values, get the current count of recorded values and create
* histogram statistics for the currently seen elements.
*/
@Public
public interface Histogram extends Metric {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@

package org.apache.flink.metrics;

import org.apache.flink.annotation.Public;

/**
* Histogram statistics represent the current snapshot of elements recorded in the histogram.
*
* <p>The histogram statistics allow to calculate values for quantiles, the mean, the standard
* deviation, the minimum and the maximum.
*/
@Public
public abstract class HistogramStatistics {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

package org.apache.flink.metrics;

import org.apache.flink.annotation.Public;

/** Metric for measuring throughput. */
@Public
public interface Meter extends Metric {

/** Mark occurrence of an event. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@

package org.apache.flink.metrics;

import org.apache.flink.annotation.Public;

/** Common super interface for all metrics. */
@Public
public interface Metric {}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

package org.apache.flink.metrics;

import org.apache.flink.annotation.Public;

import java.util.Map;

/**
Expand All @@ -28,6 +30,7 @@
*
* <p>A MetricGroup is uniquely identified by it's place in the hierarchy and name.
*/
@Public
public interface MetricGroup {

// ------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@

package org.apache.flink.metrics.groups;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.metrics.MetricGroup;

/**
* Special {@link MetricGroup} representing an Operator coordinator.
*
* <p>You should only update the metrics in the coordinator thread.
*/
@PublicEvolving
public interface OperatorCoordinatorMetricGroup extends MetricGroup {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.flink.metrics.groups;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.metrics.Counter;
import org.apache.flink.metrics.MetricGroup;

Expand All @@ -25,6 +26,7 @@
*
* <p>You should only update the metrics in the main operator thread.
*/
@PublicEvolving
public interface OperatorIOMetricGroup extends MetricGroup {
/**
* The total number of input records since the operator started. Will also populate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@

package org.apache.flink.metrics.groups;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.metrics.MetricGroup;

/**
* Special {@link org.apache.flink.metrics.MetricGroup} representing an Operator.
*
* <p>You should only update the metrics in the main operator thread.
*/
@PublicEvolving
public interface OperatorMetricGroup extends MetricGroup {
OperatorIOMetricGroup getIOMetricGroup();
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.flink.metrics.groups;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.metrics.Counter;
import org.apache.flink.metrics.Gauge;

Expand All @@ -25,6 +26,7 @@
*
* <p>You should only update the metrics in the main operator thread.
*/
@PublicEvolving
public interface SinkWriterMetricGroup extends OperatorMetricGroup {
/** The total number of records failed to send. */
Counter getNumRecordsOutErrorsCounter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.flink.metrics.groups;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.metrics.Counter;
import org.apache.flink.metrics.Gauge;

Expand All @@ -25,6 +26,7 @@
*
* <p>You should only update the metrics in the main operator thread.
*/
@PublicEvolving
public interface SourceReaderMetricGroup extends OperatorMetricGroup {
/** The total number of record that failed to consume, process, or emit. */
Counter getNumRecordsInErrorsCounter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@

package org.apache.flink.metrics.groups;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.metrics.Gauge;

/**
* Pre-defined metrics for {@code SplitEnumerator}.
*
* <p>You should only update the metrics in the main operator thread.
*/
@PublicEvolving
public interface SplitEnumeratorMetricGroup extends OperatorCoordinatorMetricGroup {
/**
* Sets an optional gauge for the number of splits that have been enumerated but not yet
Expand Down

0 comments on commit 549e1b1

Please sign in to comment.