1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.commsen.stopwatch.reports;
18
19 /***
20 * This report contains additional memory usage statistics. It is used by
21 * {@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 /***
35 * @param group
36 * @param name
37 * @param count
38 * @param fastest
39 * @param slowest
40 * @param average
41 * @param total
42 * @param minMemory
43 * @param maxMemory
44 * @param averageMemory
45 */
46 public MemoryStopwatchReport(String group, String name, long count, double fastest, double slowest, double average, double total, long minMemory, long maxMemory, long averageMemory) {
47 super(group, name, count, fastest, slowest, average, total);
48 this.minMemory = minMemory;
49 this.maxMemory = maxMemory;
50 this.averageMemory = averageMemory;
51 }
52
53
54 /***
55 * Generates string representation of this report
56 *
57 * @see java.lang.Object#toString()
58 */
59 public String toString() {
60 return new StringBuffer(super.toString()).append(" MinMem=").append(minMemory).append(" AvgMem=").append(averageMemory).append(" MaxMem=").append(maxMemory).toString();
61 }
62
63
64 /***
65 * @return Returns the averageMemory.
66 */
67 public long getAverageMemory() {
68 return averageMemory;
69 }
70
71
72 /***
73 * @return Returns the maxMemory.
74 */
75 public long getMaxMemory() {
76 return maxMemory;
77 }
78
79
80 /***
81 * @return Returns the minMemory.
82 */
83 public long getMinMemory() {
84 return minMemory;
85 }
86
87
88
89
90
91
92
93 public boolean equals(Object obj) {
94
95 return super.equals(obj);
96 }
97
98
99
100
101
102
103
104 public int hashCode() {
105
106 return super.hashCode();
107 }
108
109 }