org.perf4j
Class GroupedTimingStatistics

java.lang.Object
  extended by org.perf4j.GroupedTimingStatistics
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class GroupedTimingStatistics
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Represents a set of TimingStatistics calculated for a specific time period for a set of tags.

Author:
Alex Devine
See Also:
Serialized Form

Constructor Summary
GroupedTimingStatistics()
          Default constructor allows you to set statistics later using the setter methods.
GroupedTimingStatistics(java.util.Collection<StopWatch> timeRecords, long startTime, long stopTime, boolean createRollupStatistics)
          Creates a GroupedTimingStatistics by separating a collection of StopWatch instances by tag and calculating statistics for each tag.
GroupedTimingStatistics(java.util.SortedMap<java.lang.String,TimingStatistics> statisticsByTag, long startTime, long stopTime, boolean createRollupStatistics)
          Creates a GroupedTimingStatistics instance for a set of tags for a specified time span.
 
Method Summary
 GroupedTimingStatistics clone()
           
 boolean equals(java.lang.Object o)
           
 long getStartTime()
           
 java.util.SortedMap<java.lang.String,TimingStatistics> getStatisticsByTag()
           
 long getStopTime()
           
 int hashCode()
           
 boolean isCreateRollupStatistics()
           
 void setCreateRollupStatistics(boolean createRollupStatistics)
           
 void setStartTime(long startTime)
           
 void setStatisticsByTag(java.util.SortedMap<java.lang.String,TimingStatistics> statisticsByTag)
           
 void setStopTime(long stopTime)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupedTimingStatistics

public GroupedTimingStatistics()
Default constructor allows you to set statistics later using the setter methods.


GroupedTimingStatistics

public GroupedTimingStatistics(java.util.SortedMap<java.lang.String,TimingStatistics> statisticsByTag,
                               long startTime,
                               long stopTime,
                               boolean createRollupStatistics)
Creates a GroupedTimingStatistics instance for a set of tags for a specified time span.

Parameters:
statisticsByTag - This Map maps String tag times to the aggregated TimingStatistics for that tag.
startTime - The start time (as reported by System.currentTimeMillis()) of the time span for which the statistics apply.
stopTime - The end time of the time span for which the statistics apply.
createRollupStatistics - Whether or not the statisticsByTag contains "rollup statistics". Rollup statistics allow users to time different execution paths of the same code block. For example, when timing a code block, one may which to log execution time with a "codeBlock.success" tag when execution completes normally and a "codeBlock.failure" tag when an exception is thrown. If rollup statistics are used, then in addition to the codeBlock.success and codeBlock.failure tags, a codeBlock tag is created that represents StopWatch logs from EITHER the success or failure tags.

GroupedTimingStatistics

public GroupedTimingStatistics(java.util.Collection<StopWatch> timeRecords,
                               long startTime,
                               long stopTime,
                               boolean createRollupStatistics)
Creates a GroupedTimingStatistics by separating a collection of StopWatch instances by tag and calculating statistics for each tag.

Parameters:
timeRecords - The collection of logged StopWatch instances
startTime - The start time (as reported by System.currentTimeMillis()) of the time span for which the statistics apply.
stopTime - The end time of the time span for which the statistics apply.
createRollupStatistics - Whether or not the statisticsByTag contains "rollup statistics". Rollup statistics allow users to time different execution paths of the same code block. For example, when timing a code block, one may which to log execution time with a "codeBlock.success" tag when execution completes normally and a "codeBlock.failure" tag when an exception is thrown. If rollup statistics are used, then in addition to the codeBlock.success and codeBlock.failure tags, a codeBlock tag is created that represents StopWatch logs from EITHER the success or failure tags.
Method Detail

getStatisticsByTag

public java.util.SortedMap<java.lang.String,TimingStatistics> getStatisticsByTag()

setStatisticsByTag

public void setStatisticsByTag(java.util.SortedMap<java.lang.String,TimingStatistics> statisticsByTag)

getStartTime

public long getStartTime()

setStartTime

public void setStartTime(long startTime)

getStopTime

public long getStopTime()

setStopTime

public void setStopTime(long stopTime)

isCreateRollupStatistics

public boolean isCreateRollupStatistics()

setCreateRollupStatistics

public void setCreateRollupStatistics(boolean createRollupStatistics)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public GroupedTimingStatistics clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2008 perf4j.org. All Rights Reserved.