Class StepCounter

  • All Implemented Interfaces:
    Counter, Meter

    public class StepCounter
    extends AbstractMeter
    implements Counter
    Counter that reports a rate per second to a monitoring system. Note that count() will report the number events in the last complete interval rather than the total for the life of the process.
    • Constructor Detail

      • StepCounter

        public StepCounter​(Meter.Id id,
                           Clock clock,
                           long stepMillis)
    • Method Detail

      • increment

        public void increment​(double amount)
        Description copied from interface: Counter
        Update the counter by amount.
        Specified by:
        increment in interface Counter
        Parameters:
        amount - Amount to add to the counter.
      • count

        public double count()
        Specified by:
        count in interface Counter
        Returns:
        The cumulative count since this counter was created.