becketqin opened a new pull request #13920:
URL: https://github.com/apache/flink/pull/13920
## What is the purpose of the change
This patch does the following:
* Moved the `MetricNames` from flink-runtime to flink-core and added the
metrics defined in FLIP-33.
* Improved the `SourceReaderBase` API to allow additional information to be
passed from the `SplitReader` to `RecordEmitter`. So that the implementations
do not have to put some common information in the records themselves.
* Report some of the metrics by default.
Metrics implemented by the SourceOperator / ReaderOutput:
1. currentEmitEventTimeLag (at a sampling frequency of once per second)
2. watermarkLag
Metrics implemented in the `SourceReaderBase` (can be overridden by
individual implementations):
1. numRecordsIn / numRecordsInPerSecond
2. sourceIdleTime
Metrics left for individual implementations to report in `SplitReader` /
`RecordEmitter` :
1. numBytesIn / numBytesInPerSecond
2. currentFetchEventTime
3. pendingBytes
4. pendingRecords
5. numRecordsInErrors (errors in SplitReader and record emitter)
## Brief change log
* Moved the `MetricNames` from flink-runtime to flink-core and added the
metrics defined in FLIP-33.
* Improved the `SourceReaderBase` API to allow additional information to be
passed from the `SplitReader` to `RecordEmitter`. So that the implementations
do not have to put some common information in the records themselves.
* Report some of the metrics by default.
## Verifying this change
Unit tests have been added to test the metrics reporting and additional
information passing between `SplitReader` and `RecordEmitter`.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (yes)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (yes)
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (yes)
- If yes, how is the feature documented? (docs / JavaDocs)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]