public class TimerGauge extends Object implements org.apache.flink.metrics.Gauge<Long>, org.apache.flink.metrics.View
TimerGauge measures how much time is spent in a given state, with entry into that state
being signaled by markStart(). Measuring is stopped by markEnd(). This class in
particularly takes care of the case, when update() is called when some measurement
started but has not yet finished. For example even if next markEnd() call is expected to
happen in a couple of hours, the returned value will account for this ongoing measurement.| Constructor and Description |
|---|
TimerGauge() |
TimerGauge(org.apache.flink.util.clock.Clock clock) |
| Modifier and Type | Method and Description |
|---|---|
long |
getCount() |
Long |
getValue() |
boolean |
isMeasuring() |
void |
markEnd() |
void |
markEnd(long absoluteTimeMillis)
Duplicate of
markEnd() with ability passing the time from outside for possible
optimization on calling Clock.absoluteTimeMillis(). |
void |
markStart() |
void |
markStart(long absoluteTimeMillis)
Duplicate of
markStart() with ability passing the time from outside for possible
optimization on calling Clock.absoluteTimeMillis(). |
void |
update() |
public TimerGauge()
public TimerGauge(org.apache.flink.util.clock.Clock clock)
public void markStart()
public void markEnd()
public void markStart(long absoluteTimeMillis)
markStart() with ability passing the time from outside for possible
optimization on calling Clock.absoluteTimeMillis().public void markEnd(long absoluteTimeMillis)
markEnd() with ability passing the time from outside for possible
optimization on calling Clock.absoluteTimeMillis().public void update()
update in interface org.apache.flink.metrics.Viewpublic Long getValue()
getValue in interface org.apache.flink.metrics.Gauge<Long>@VisibleForTesting public long getCount()
@VisibleForTesting public boolean isMeasuring()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.