This can't be implemented as there's no guarantee that getValue is only called once.

Why do you want to reset the count? If you're interested in rates, why aren't you using a meter?

On 10/07/2019 09:37, Xintong Song wrote:
Hi Singh,

Could your problem be solved by simply record the previous value and subtract it from the new value?

Thank you~

Xintong Song



On Wed, Jul 10, 2019 at 3:33 PM M Singh <mans2si...@yahoo.com <mailto:mans2si...@yahoo.com>> wrote:

    Hi:

    I am working on a Flink application and need to collect the number
    of events of certain type/second (per unit of time) as a metric. 
    I was hoping to use Flink's metric framework with a gauge but did
    not find any implementation that will reset the count after it is
    reported.

    The example:
    
https://ci.apache.org/projects/flink/flink-docs-release-1.8/monitoring/metrics.html#gauge
 shows
    how to use a gauge but does not reset the gauge after the metrics
    framework has reported the value every at the specified interval. 
     So, unless it is reset by the application (after the call to
    getValue), it will continue to increment.

    I was wondering if there is any resettable gauge implementation
    available that integrates with the Flink metrics framework.

    Please let me know if there are any advice/pointers.

    Thanks

    Mans




Reply via email to