GitHub user zentol opened a pull request: https://github.com/apache/flink/pull/4901
[FLINK-7781][metrics][REST] Support on-demand aggregations ## What is the purpose of the change This PR adds on-demand aggregation support to the metrics REST API. It allows aggregating * taskmanagers metrics across all taskmanagers * job metrics across all jobs * subtask metrics across all subtasks The aggregation is handled by new handlers as described in the documentation. Additionally, a subtask metric handler was added to subsume the existing JobVertexMetricsHandler to expose subtask metrics in a more idiomatic way. The JobVertexMetricsHandler was not removed for backwards compatibility (with the webUI in particular): ## Brief change log * fix the requests examples in the metric handler javadocs * implement aggregation handlers * expose all subtask stores in TaskMetricStore for easier access * extend MetricStoreTest#setupMetricStore to contain metrics for multiple entities * integrate aggregation handlers into WebRuntimeMonitor * document the metrics REST API ## Verifying this change This change added tests for each Aggregating*MetricsHandler and for the abstract base class (AbstractAggregatingMetricsHandlerTest). This change can be verified manually by running multiple taskmanagers/jobs/subtasks in the cluster and querying the rest endpoints as described in the documentation. ## 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)`: (no) - The serializers: (no) - The runtime per-record code paths (performance sensitive): (no) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no) ## Documentation - Does this pull request introduce a new feature? (yes) - If yes, how is the feature documented? (docs) You can merge this pull request into a Git repository by running: $ git pull https://github.com/zentol/flink 7781 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/4901.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #4901 ---- commit 4a3f51157180241210160fb73508f406c9192bc2 Author: zentol <ches...@apache.org> Date: 2017-10-25T07:42:14Z [hotfix][javadocs] Fix metric handler example javadocs commit afabf6fb72c2b2bd94fb0410c985e61e940d138e Author: zentol <ches...@apache.org> Date: 2017-10-25T09:21:28Z [FLINK-7781][metrics][REST] Support on-demand aggregations commit f768be1ebe0059b30571c43950f0942a7919bb0c Author: zentol <ches...@apache.org> Date: 2017-10-25T09:21:46Z [FLINK-7912][metrics][docs] Document metrics REST API ---- ---