Class LatencyStats


  • public class LatencyStats
    extends Object
    An instance of LatencyStats keeps track of statistics related to time intervals that start at a particular moment in time and ends at a later time. A typical example is the processing of requests: Each newly received request starts a new interval, and ends when the response is sent.

    The statistics only applies to the current time period, and can be retrieved as a LatencyMetrics instance from e.g. getLatencyMetrics(). This fits well with how Yamas works: it collects metrics since last collection every minute or so.

    Author:
    hakon
    See Also:
    LatencyMetrics
    • Constructor Detail

      • LatencyStats

        public LatencyStats()
        Creates an empty LatencyStats starting the first time period now.
    • Method Detail

      • getLatencyMetrics

        public LatencyMetrics getLatencyMetrics()
        Returns the metrics for the current time period up to now.
      • getLatencyMetricsAndStartNewPeriod

        public LatencyMetrics getLatencyMetricsAndStartNewPeriod()
        Returns the metrics for the current time period up to now, and starts a new period.