Class ResidueCounter
- All Implemented Interfaces:
org.apache.flink.metrics.Counter,org.apache.flink.metrics.Metric
Counter view of one PubSubShutdownResidue adder, so a residue
registers as the counter it is rather than as a gauge over a monotonic total.
Named for the storage rather than for one of the things stored, which the four adders it serves make necessary: a subscriber failure nothing consumed is a teardown outcome and not an abandoned shutdown, so a name about abandoning would be false at one of the four call sites.
Registering a caller-supplied Counter is what lets the instrument be right while the
storage stays process-wide: the count has to outlive the task (see PubSubShutdownResidue), and a cumulative count of events is a counter by the naming convention.
The mutators throw. Nothing calls them: a metric group only registers the instance and
reporters only read getCount() — incrementing is done by the teardowns, through the
adder PubSubShutdownResidue hands them. A silent no-op would hide a caller that believed
it was counting something.
-
Constructor Details
-
ResidueCounter
Creates the view.- Parameters:
residue- the adder the teardowns count into
-
-
Method Details
-
inc
public void inc()- Specified by:
incin interfaceorg.apache.flink.metrics.Counter
-
inc
public void inc(long n) - Specified by:
incin interfaceorg.apache.flink.metrics.Counter
-
dec
public void dec()- Specified by:
decin interfaceorg.apache.flink.metrics.Counter
-
dec
public void dec(long n) - Specified by:
decin interfaceorg.apache.flink.metrics.Counter
-
getCount
public long getCount()- Specified by:
getCountin interfaceorg.apache.flink.metrics.Counter
-