View Javadoc

1   /*
2    * $Id: LoadStopwatchReport.java,v 1.1 2006/03/01 17:48:05 azzazzel Exp $
3    *
4    * Copyright 2006 Commsen International
5    * 
6    * Licensed under the Common Public License, Version 1.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * 
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  /***
21   * This report contains additional "load" statistics.  
22   * The value of "load" shows how many instances of the code being measured are running simultaneously.
23   * This report is udes by  {@link com.commsen.stopwatch.engines.LoadStopwatchEngine} 
24   *
25   * @deprecated new method {@link com.commsen.stopwatch.Stopwatch#getLoad(int, int)} introduced in version 0.3  
26   * @author Milen Dyankov
27   */
28  public class LoadStopwatchReport extends DefaultStopwatchReport {
29  
30  	private static final long serialVersionUID = 1L;
31  	
32  	private long minLoad;
33  	private long maxLoad;
34  	private long averageLoad;
35  
36  
37  	/***
38  	 * @param group
39  	 * @param label
40  	 * @param count
41  	 * @param minTime
42  	 * @param maxTime
43  	 * @param averageTime
44  	 * @param totalTime
45  	 * @param minLoad
46  	 * @param maxLoad
47  	 * @param averageLoad
48  	 */
49  	public LoadStopwatchReport(String group, String label, long count, long minTime, long maxTime, long averageTime, long totalTime, long minLoad, long maxLoad, long averageLoad) {
50  		super (group, label, count, minTime, maxTime, averageTime, 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 
62  			new StringBuffer(super.toString())
63  			.append("  MinLoad=").append(minLoad) 
64  			.append("  AvgLoad=").append(averageLoad) 
65  			.append("  MaxLoad=").append(maxLoad) 
66  			.toString();
67  	}
68  	
69  
70  	/***
71  	 * @return Returns the averageLoad.
72  	 */
73  	public long getAverageLoad() {
74  		return averageLoad;
75  	}
76  
77  	/***
78  	 * @return Returns the maxLoad.
79  	 */
80  	public long getMaxLoad() {
81  		return maxLoad;
82  	}
83  
84  	/***
85  	 * @return Returns the minLoad.
86  	 */
87  	public long getMinLoad() {
88  		return minLoad;
89  	}
90  
91  	/* (non-Javadoc)
92       * @see com.commsen.stopwatch.reports.DefaultStopwatchReport#equals(java.lang.Object)
93       */
94      public boolean equals(Object obj) {
95  	    // TODO Auto-generated method stub
96  	    return super.equals(obj);
97      }
98  
99  	/* (non-Javadoc)
100      * @see com.commsen.stopwatch.reports.DefaultStopwatchReport#hashCode()
101      */
102     public int hashCode() {
103 	    // TODO Auto-generated method stub
104 	    return super.hashCode();
105     }
106 
107 }