01: /*
02: * $Id: MemoryStopwatchReport.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 memory usage statistics.
21: * It is used by {@link com.commsen.stopwatch.engines.MemoryStopwatchEngine};
22: *
23: * @author Milen Dyankov
24: */
25: public class MemoryStopwatchReport extends DefaultStopwatchReport {
26:
27: private static final long serialVersionUID = 1L;
28:
29: private long minMemory;
30: private long maxMemory;
31: private long averageMemory;
32:
33: /**
34: * @param group
35: * @param name
36: * @param count
37: * @param fastest
38: * @param slowest
39: * @param average
40: * @param total
41: * @param minMemory
42: * @param maxMemory
43: * @param averageMemory
44: */
45: public MemoryStopwatchReport(String group, String name, long count,
46: long fastest, long slowest, long average, long total,
47: long minMemory, long maxMemory, long averageMemory) {
48: super (group, name, count, fastest, slowest, average, total);
49: this .minMemory = minMemory;
50: this .maxMemory = maxMemory;
51: this .averageMemory = averageMemory;
52: }
53:
54: /**
55: * Generates string representation of this report
56: * @see java.lang.Object#toString()
57: */
58: public String toString() {
59: return new StringBuffer(super .toString()).append(" MinMem=")
60: .append(minMemory).append(" AvgMem=").append(
61: averageMemory).append(" MaxMem=").append(
62: maxMemory).toString();
63: }
64:
65: /**
66: * @return Returns the averageMemory.
67: */
68: public long getAverageMemory() {
69: return averageMemory;
70: }
71:
72: /**
73: * @return Returns the maxMemory.
74: */
75: public long getMaxMemory() {
76: return maxMemory;
77: }
78:
79: /**
80: * @return Returns the minMemory.
81: */
82: public long getMinMemory() {
83: return minMemory;
84: }
85:
86: }
|