Package com.yahoo.vespa.curator.stats
Class LatencyStats
- java.lang.Object
-
- com.yahoo.vespa.curator.stats.LatencyStats
-
public class LatencyStats extends Object
An instance ofLatencyStats
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
LatencyStats.ActiveInterval
-
Constructor Summary
Constructors Constructor Description LatencyStats()
Creates an empty LatencyStats starting the first time period now.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LatencyMetrics
getLatencyMetrics()
Returns the metrics for the current time period up to now.LatencyMetrics
getLatencyMetricsAndStartNewPeriod()
Returns the metrics for the current time period up to now, and starts a new period.LatencyStats.ActiveInterval
startNewInterval()
Starts a new (active) interval.
-
-
-
Method Detail
-
startNewInterval
public LatencyStats.ActiveInterval startNewInterval()
Starts a new (active) interval. The caller MUST callLatencyStats.ActiveInterval.close()
on the returned instance exactly once, which will end the interval.
-
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.
-
-