01: /*
02: * $Id: LoadStopwatchReport.java,v 1.1 2006/03/01 17:48:05 azzazzel Exp $
03: *
04: * Copyright 2006 Commsen International
05: *
06: * Licensed under the Common Public License, Version 1.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.opensource.org/licenses/cpl1.0.txt
11: *
12: * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13: * EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS
14: * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
15: *
16: */
17: package com.commsen.stopwatch.reports;
18:
19: /**
20: * This report contains additional "load" statistics.
21: * The value of "load" shows how many instances of the code being measured are running simultaneously.
22: * This report is udes by {@link com.commsen.stopwatch.engines.LoadStopwatchEngine}
23: *
24: * @author Milen Dyankov
25: */
26: public class LoadStopwatchReport extends DefaultStopwatchReport {
27:
28: private static final long serialVersionUID = 1L;
29:
30: private long minLoad;
31: private long maxLoad;
32: private long averageLoad;
33:
34: /**
35: * @param group
36: * @param label
37: * @param count
38: * @param minTime
39: * @param maxTime
40: * @param averageTime
41: * @param totalTime
42: * @param minLoad
43: * @param maxLoad
44: * @param averageLoad
45: */
46: public LoadStopwatchReport(String group, String label, long count,
47: long minTime, long maxTime, long averageTime,
48: long totalTime, long minLoad, long maxLoad, long averageLoad) {
49: super (group, label, count, minTime, maxTime, averageTime,
50: totalTime);
51: this .minLoad = minLoad;
52: this .maxLoad = maxLoad;
53: this .averageLoad = averageLoad;
54: }
55:
56: /**
57: * Generates string representation of this report
58: * @see java.lang.Object#toString()
59: */
60: public String toString() {
61: return new StringBuffer(super .toString()).append(" MinLoad=")
62: .append(minLoad).append(" AvgLoad=").append(
63: averageLoad).append(" MaxLoad=").append(
64: maxLoad).toString();
65: }
66:
67: /**
68: * @return Returns the averageLoad.
69: */
70: public long getAverageLoad() {
71: return averageLoad;
72: }
73:
74: /**
75: * @return Returns the maxLoad.
76: */
77: public long getMaxLoad() {
78: return maxLoad;
79: }
80:
81: /**
82: * @return Returns the minLoad.
83: */
84: public long getMinLoad() {
85: return minLoad;
86: }
87:
88: }
|