GitHub user zentol opened a pull request:
https://github.com/apache/flink/pull/2443
[FLINK-3950] Implement MeterView
In the JIRA discussion about FLINK-3950 @StephanEwen introduced the notion
of a `MetricView`, a `Meter`that derives it's values from another Counter or
Gauge. The `View` would not be updated when the backing metric is modified, but
instead by a background thread shared by all `Views`.
This PR implements a `Meter` that derives it's values from a `Counter`,
called `MeterView`.
The `View` class is a small interface, only containing an `update()` method.
A `TimerTask` running in the `MetricRegistry` calls this `update()` method
on all `Views`, with a hard-coded update interval of 5 seconds.
The `MeterView` class implements both `View` and `Meter`. It maintains a
history of N measurements in a `long[N]` which is updated whenever
`View#update()` is called. The rate is only calculated on demand.
The PR contains a small example, demonstrating how a `MeterView` would be
created & registered in the `AbstractStreamOperator`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zentol/flink metrics_view
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/2443.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 #2443
----
commit 9b9d85600912179e7fe7c96f6e2dac77bcf09563
Author: zentol <[email protected]>
Date: 2016-08-31T13:47:17Z
[FLINK-3950] Implement MeterView
commit 929a87a3dac22258517761fef84c73bfd85a7952
Author: zentol <[email protected]>
Date: 2016-08-31T13:47:48Z
example
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---