org.javasimon.callback.timeline
Class StopwatchTimeRange

java.lang.Object
  extended by org.javasimon.callback.timeline.TimeRange
      extended by org.javasimon.callback.timeline.StopwatchTimeRange

public class StopwatchTimeRange
extends TimeRange

Stopwatch statistics gathered for a specific time range. This class is not intended to be thread safe.

Author:
gerald

Field Summary
private  long counter
          Counter (Number of values)
private  long last
          Last value
private  long max
          Minimum
private  long min
          Minimum
private  long squareTotal
          (Sum of square of all values)
private  long total
          Total (Sum of all values)
 
Fields inherited from class org.javasimon.callback.timeline.TimeRange
lastTimestamp
 
Constructor Summary
StopwatchTimeRange(long startTimestamp, long endTimestamp)
          Main constructor.
 
Method Summary
 void addSplit(long timestampInMs, long durationInNs)
          Add stopwatch split information.
private  double computeMean()
          Compute mean/average using total and counter
 long getCounter()
           
 long getLast()
           
 long getMax()
           
 Double getMean()
          Compute mean/average.
 long getMin()
           
 Double getStandardDeviation()
          Compute standard deviation.
 long getTotal()
           
 Double getVariance()
          Compute variance.
protected  StringBuilder toStringBuilder(StringBuilder stringBuilder)
           
 
Methods inherited from class org.javasimon.callback.timeline.TimeRange
containsTimestamp, getEndTimestamp, getStartTimestamp, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

last

private long last
Last value


min

private long min
Minimum


max

private long max
Minimum


total

private long total
Total (Sum of all values)


squareTotal

private long squareTotal
(Sum of square of all values)


counter

private long counter
Counter (Number of values)

Constructor Detail

StopwatchTimeRange

public StopwatchTimeRange(long startTimestamp,
                          long endTimestamp)
Main constructor.

Method Detail

addSplit

public void addSplit(long timestampInMs,
                     long durationInNs)
Add stopwatch split information.

Parameters:
timestampInMs - When the split started, expressed in milliseconds
durationInNs - How long the split was, expressed in nanoseconds

getLast

public long getLast()

getMin

public long getMin()

getMax

public long getMax()

getTotal

public long getTotal()

getCounter

public long getCounter()

computeMean

private double computeMean()
Compute mean/average using total and counter


getMean

public Double getMean()
Compute mean/average.

Returns:
mean/average duration.

getVariance

public Double getVariance()
Compute variance.

Returns:
variance

getStandardDeviation

public Double getStandardDeviation()
Compute standard deviation.

Returns:
Standard deviation

toStringBuilder

protected StringBuilder toStringBuilder(StringBuilder stringBuilder)
Overrides:
toStringBuilder in class TimeRange


Copyright © 2013. All Rights Reserved.