author | ohair |
Tue, 28 Dec 2010 15:53:50 -0800 | |
changeset 7668 | d4a77089c587 |
parent 7233 | e560b64571c7 |
child 10292 | ed7db6a12c2a |
permissions | -rw-r--r-- |
2 | 1 |
/* |
7668 | 2 |
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
|
5 |
* modification, are permitted provided that the following conditions |
|
6 |
* are met: |
|
7 |
* |
|
8 |
* - Redistributions of source code must retain the above copyright |
|
9 |
* notice, this list of conditions and the following disclaimer. |
|
10 |
* |
|
11 |
* - Redistributions in binary form must reproduce the above copyright |
|
12 |
* notice, this list of conditions and the following disclaimer in the |
|
13 |
* documentation and/or other materials provided with the distribution. |
|
14 |
* |
|
5506 | 15 |
* - Neither the name of Oracle nor the names of its |
2 | 16 |
* contributors may be used to endorse or promote products derived |
17 |
* from this software without specific prior written permission. |
|
18 |
* |
|
19 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS |
|
20 |
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
|
21 |
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|
22 |
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
|
23 |
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
|
24 |
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|
25 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
|
26 |
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
|
27 |
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
|
28 |
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
29 |
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
30 |
*/ |
|
31 |
||
32 |
package j2dbench; |
|
33 |
||
34 |
import java.util.Vector; |
|
35 |
import java.util.Hashtable; |
|
36 |
import java.util.Enumeration; |
|
37 |
import java.io.PrintWriter; |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
38 |
import java.util.HashMap; |
2 | 39 |
|
40 |
public class Result { |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
41 |
public static final int RATE_UNKNOWN = 0; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
42 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
43 |
public static final int WORK_OPS = 1; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
44 |
public static final int WORK_UNITS = 2; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
45 |
public static final int WORK_THOUSANDS = 4; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
46 |
public static final int WORK_MILLIONS = 6; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
47 |
public static final int WORK_AUTO = 8; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
48 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
49 |
public static final int TIME_SECONDS = 10; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
50 |
public static final int TIME_MILLIS = 11; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
51 |
public static final int TIME_MICROS = 12; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
52 |
public static final int TIME_NANOS = 13; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
53 |
public static final int TIME_AUTO = 14; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
54 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
55 |
static Group resultoptroot; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
56 |
static Option.ObjectChoice timeOpt; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
57 |
static Option.ObjectChoice workOpt; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
58 |
static Option.ObjectChoice rateOpt; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
59 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
60 |
public static void init() { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
61 |
resultoptroot = new Group(TestEnvironment.globaloptroot, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
62 |
"results", "Result Options"); |
2 | 63 |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
64 |
String workStrings[] = { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
65 |
"units", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
66 |
"kilounits", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
67 |
"megaunits", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
68 |
"autounits", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
69 |
"ops", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
70 |
"kiloops", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
71 |
"megaops", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
72 |
"autoops", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
73 |
}; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
74 |
String workDescriptions[] = { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
75 |
"Test Units", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
76 |
"Thousands of Test Units", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
77 |
"Millions of Test Units", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
78 |
"Auto-scaled Test Units", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
79 |
"Operations", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
80 |
"Thousands of Operations", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
81 |
"Millions of Operations", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
82 |
"Auto-scaled Operations", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
83 |
}; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
84 |
Integer workObjects[] = { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
85 |
new Integer(WORK_UNITS), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
86 |
new Integer(WORK_THOUSANDS), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
87 |
new Integer(WORK_MILLIONS), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
88 |
new Integer(WORK_AUTO), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
89 |
new Integer(WORK_OPS | WORK_UNITS), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
90 |
new Integer(WORK_OPS | WORK_THOUSANDS), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
91 |
new Integer(WORK_OPS | WORK_MILLIONS), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
92 |
new Integer(WORK_OPS | WORK_AUTO), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
93 |
}; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
94 |
workOpt = new Option.ObjectChoice(resultoptroot, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
95 |
"workunits", "Work Units", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
96 |
workStrings, workObjects, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
97 |
workStrings, workDescriptions, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
98 |
0); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
99 |
String timeStrings[] = { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
100 |
"sec", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
101 |
"msec", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
102 |
"usec", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
103 |
"nsec", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
104 |
"autosec", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
105 |
}; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
106 |
String timeDescriptions[] = { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
107 |
"Seconds", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
108 |
"Milliseconds", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
109 |
"Microseconds", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
110 |
"Nanoseconds", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
111 |
"Auto-scaled seconds", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
112 |
}; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
113 |
Integer timeObjects[] = { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
114 |
new Integer(TIME_SECONDS), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
115 |
new Integer(TIME_MILLIS), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
116 |
new Integer(TIME_MICROS), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
117 |
new Integer(TIME_NANOS), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
118 |
new Integer(TIME_AUTO), |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
119 |
}; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
120 |
timeOpt = new Option.ObjectChoice(resultoptroot, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
121 |
"timeunits", "Time Units", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
122 |
timeStrings, timeObjects, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
123 |
timeStrings, timeDescriptions, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
124 |
0); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
125 |
String rateStrings[] = { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
126 |
"unitspersec", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
127 |
"secsperunit", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
128 |
}; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
129 |
String rateDescriptions[] = { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
130 |
"Work units per Time", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
131 |
"Time units per Work", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
132 |
}; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
133 |
Boolean rateObjects[] = { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
134 |
Boolean.FALSE, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
135 |
Boolean.TRUE, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
136 |
}; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
137 |
rateOpt = new Option.ObjectChoice(resultoptroot, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
138 |
"ratio", "Rate Ratio", |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
139 |
rateStrings, rateObjects, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
140 |
rateStrings, rateDescriptions, |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
141 |
0); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
142 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
143 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
144 |
public static boolean isTimeUnit(int unit) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
145 |
return (unit >= TIME_SECONDS && unit <= TIME_AUTO); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
146 |
} |
2 | 147 |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
148 |
public static boolean isWorkUnit(int unit) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
149 |
return (unit >= WORK_OPS && unit <= (WORK_AUTO | WORK_OPS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
150 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
151 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
152 |
public static String parseRateOpt(String opt) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
153 |
int timeScale = timeOpt.getIntValue(); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
154 |
int workScale = workOpt.getIntValue(); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
155 |
boolean invertRate = rateOpt.getBooleanValue(); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
156 |
int divindex = opt.indexOf('/'); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
157 |
if (divindex < 0) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
158 |
int unit = parseUnit(opt); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
159 |
if (isTimeUnit(unit)) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
160 |
timeScale = unit; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
161 |
} else if (isWorkUnit(unit)) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
162 |
workScale = unit; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
163 |
} else { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
164 |
return "Bad unit: "+opt; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
165 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
166 |
} else { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
167 |
int unit1 = parseUnit(opt.substring(0,divindex)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
168 |
int unit2 = parseUnit(opt.substring(divindex+1)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
169 |
if (isTimeUnit(unit1)) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
170 |
if (isWorkUnit(unit2)) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
171 |
timeScale = unit1; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
172 |
workScale = unit2; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
173 |
invertRate = true; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
174 |
} else if (isTimeUnit(unit2)) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
175 |
return "Both time units: "+opt; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
176 |
} else { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
177 |
return "Bad denominator: "+opt; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
178 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
179 |
} else if (isWorkUnit(unit1)) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
180 |
if (isWorkUnit(unit2)) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
181 |
return "Both work units: "+opt; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
182 |
} else if (isTimeUnit(unit2)) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
183 |
timeScale = unit2; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
184 |
workScale = unit1; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
185 |
invertRate = false; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
186 |
} else { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
187 |
return "Bad denominator: "+opt; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
188 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
189 |
} else { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
190 |
return "Bad numerator: "+opt; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
191 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
192 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
193 |
timeOpt.setValue(timeScale); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
194 |
workOpt.setValue(workScale); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
195 |
rateOpt.setValue(invertRate); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
196 |
return null; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
197 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
198 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
199 |
private static HashMap unitMap; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
200 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
201 |
static { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
202 |
unitMap = new HashMap(); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
203 |
unitMap.put("U", new Integer(WORK_UNITS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
204 |
unitMap.put("M", new Integer(WORK_MILLIONS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
205 |
unitMap.put("K", new Integer(WORK_THOUSANDS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
206 |
unitMap.put("A", new Integer(WORK_AUTO)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
207 |
unitMap.put("MU", new Integer(WORK_MILLIONS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
208 |
unitMap.put("KU", new Integer(WORK_THOUSANDS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
209 |
unitMap.put("AU", new Integer(WORK_AUTO)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
210 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
211 |
unitMap.put("O", new Integer(WORK_UNITS | WORK_OPS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
212 |
unitMap.put("NO", new Integer(WORK_UNITS | WORK_OPS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
213 |
unitMap.put("MO", new Integer(WORK_MILLIONS | WORK_OPS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
214 |
unitMap.put("KO", new Integer(WORK_THOUSANDS | WORK_OPS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
215 |
unitMap.put("AO", new Integer(WORK_AUTO | WORK_OPS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
216 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
217 |
unitMap.put("s", new Integer(TIME_SECONDS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
218 |
unitMap.put("m", new Integer(TIME_MILLIS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
219 |
unitMap.put("u", new Integer(TIME_MICROS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
220 |
unitMap.put("n", new Integer(TIME_NANOS)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
221 |
unitMap.put("a", new Integer(TIME_AUTO)); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
222 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
223 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
224 |
public static int parseUnit(String c) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
225 |
Integer u = (Integer) unitMap.get(c); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
226 |
if (u != null) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
227 |
return u.intValue(); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
228 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
229 |
return RATE_UNKNOWN; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
230 |
} |
2 | 231 |
|
232 |
String unitname = "unit"; |
|
233 |
Test test; |
|
234 |
int repsPerRun; |
|
235 |
int unitsPerRep; |
|
236 |
Vector times; |
|
237 |
Hashtable modifiers; |
|
238 |
Throwable error; |
|
239 |
||
240 |
public Result(Test test) { |
|
241 |
this.test = test; |
|
242 |
this.repsPerRun = 1; |
|
243 |
this.unitsPerRep = 1; |
|
244 |
times = new Vector(); |
|
245 |
} |
|
246 |
||
247 |
public void setReps(int reps) { |
|
248 |
this.repsPerRun = reps; |
|
249 |
} |
|
250 |
||
251 |
public void setUnits(int units) { |
|
252 |
this.unitsPerRep = units; |
|
253 |
} |
|
254 |
||
255 |
public void setUnitName(String name) { |
|
256 |
this.unitname = name; |
|
257 |
} |
|
258 |
||
259 |
public void addTime(long time) { |
|
260 |
if (J2DBench.printresults.isEnabled()) { |
|
261 |
System.out.println(test+" took "+time+"ms for "+ |
|
262 |
getRepsPerRun()+" reps"); |
|
263 |
} |
|
264 |
times.addElement(new Long(time)); |
|
265 |
} |
|
266 |
||
267 |
public void setError(Throwable t) { |
|
268 |
this.error = t; |
|
269 |
} |
|
270 |
||
271 |
public void setModifiers(Hashtable modifiers) { |
|
272 |
this.modifiers = modifiers; |
|
273 |
} |
|
274 |
||
275 |
public Throwable getError() { |
|
276 |
return error; |
|
277 |
} |
|
278 |
||
279 |
public int getRepsPerRun() { |
|
280 |
return repsPerRun; |
|
281 |
} |
|
282 |
||
283 |
public int getUnitsPerRep() { |
|
284 |
return unitsPerRep; |
|
285 |
} |
|
286 |
||
287 |
public long getUnitsPerRun() { |
|
288 |
return ((long) getRepsPerRun()) * ((long) getUnitsPerRep()); |
|
289 |
} |
|
290 |
||
291 |
public Hashtable getModifiers() { |
|
292 |
return modifiers; |
|
293 |
} |
|
294 |
||
295 |
public long getNumRuns() { |
|
296 |
return times.size(); |
|
297 |
} |
|
298 |
||
299 |
public long getTime(int index) { |
|
300 |
return ((Long) times.elementAt(index)).longValue(); |
|
301 |
} |
|
302 |
||
303 |
public double getRepsPerSecond(int index) { |
|
304 |
return (getRepsPerRun() * 1000.0) / getTime(index); |
|
305 |
} |
|
306 |
||
307 |
public double getUnitsPerSecond(int index) { |
|
308 |
return (getUnitsPerRun() * 1000.0) / getTime(index); |
|
309 |
} |
|
310 |
||
311 |
public long getTotalReps() { |
|
312 |
return getRepsPerRun() * getNumRuns(); |
|
313 |
} |
|
314 |
||
315 |
public long getTotalUnits() { |
|
316 |
return getUnitsPerRun() * getNumRuns(); |
|
317 |
} |
|
318 |
||
319 |
public long getTotalTime() { |
|
320 |
long totalTime = 0; |
|
321 |
for (int i = 0; i < times.size(); i++) { |
|
322 |
totalTime += getTime(i); |
|
323 |
} |
|
324 |
return totalTime; |
|
325 |
} |
|
326 |
||
327 |
public double getAverageRepsPerSecond() { |
|
328 |
return (getTotalReps() * 1000.0) / getTotalTime(); |
|
329 |
} |
|
330 |
||
331 |
public double getAverageUnitsPerSecond() { |
|
332 |
return (getTotalUnits() * 1000.0) / getTotalTime(); |
|
333 |
} |
|
334 |
||
335 |
public String getAverageString() { |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
336 |
int timeScale = timeOpt.getIntValue(); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
337 |
int workScale = workOpt.getIntValue(); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
338 |
boolean invertRate = rateOpt.getBooleanValue(); |
2 | 339 |
double time = getTotalTime(); |
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
340 |
String timeprefix = ""; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
341 |
switch (timeScale) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
342 |
case TIME_AUTO: |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
343 |
case TIME_SECONDS: |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
344 |
time /= 1000; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
345 |
break; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
346 |
case TIME_MILLIS: |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
347 |
timeprefix = "m"; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
348 |
break; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
349 |
case TIME_MICROS: |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
350 |
time *= 1000.0; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
351 |
timeprefix = "u"; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
352 |
break; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
353 |
case TIME_NANOS: |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
354 |
time *= 1000000.0; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
355 |
timeprefix = "n"; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
356 |
break; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
357 |
} |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
358 |
|
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
359 |
String workprefix = ""; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
360 |
boolean isOps = (workScale & WORK_OPS) != 0; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
361 |
String workname = isOps ? "op" : unitname; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
362 |
double work = isOps ? getTotalReps() : getTotalUnits(); |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
363 |
switch (workScale & (~WORK_OPS)) { |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
364 |
case WORK_AUTO: |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
365 |
case WORK_UNITS: |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
366 |
break; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
367 |
case WORK_THOUSANDS: |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
368 |
work /= 1000.0; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
369 |
workprefix = "K"; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
370 |
break; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
371 |
case WORK_MILLIONS: |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
372 |
work /= 1000000.0; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
373 |
workprefix = "M"; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
374 |
break; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
375 |
} |
2 | 376 |
if (invertRate) { |
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
377 |
double rate = time / work; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
378 |
if (timeScale == TIME_AUTO) { |
2 | 379 |
if (rate < 1.0) { |
380 |
rate *= 1000.0; |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
381 |
timeprefix = "m"; |
2 | 382 |
if (rate < 1.0) { |
383 |
rate *= 1000.0; |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
384 |
timeprefix = "u"; |
2 | 385 |
if (rate < 1.0) { |
386 |
rate *= 1000.0; |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
387 |
timeprefix = "n"; |
2 | 388 |
} |
389 |
} |
|
390 |
} |
|
391 |
} |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
392 |
return rate+" "+timeprefix+"secs/"+workprefix+workname; |
2 | 393 |
} else { |
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
394 |
double rate = work / time; |
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
395 |
if (workScale == WORK_AUTO) { |
2 | 396 |
if (rate > 1000.0) { |
397 |
rate /= 1000.0; |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
398 |
workprefix = "K"; |
2 | 399 |
if (rate > 1000.0) { |
400 |
rate /= 1000.0; |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
401 |
workprefix = "M"; |
2 | 402 |
} |
403 |
} |
|
404 |
} |
|
7233
e560b64571c7
6689925: Add transform attributes to the rendering tests in J2DBench
jgodinez
parents:
5506
diff
changeset
|
405 |
return rate+" "+workprefix+workname+"s/"+timeprefix+"sec"; |
2 | 406 |
} |
407 |
} |
|
408 |
||
409 |
public void summarize() { |
|
410 |
if (error != null) { |
|
411 |
System.out.println(test+" skipped due to "+error); |
|
412 |
error.printStackTrace(System.out); |
|
413 |
} else { |
|
414 |
System.out.println(test+" averaged "+getAverageString()); |
|
415 |
} |
|
416 |
if (true) { |
|
417 |
Enumeration enum_ = modifiers.keys(); |
|
418 |
System.out.print(" with"); |
|
419 |
String sep = " "; |
|
420 |
while (enum_.hasMoreElements()) { |
|
421 |
Modifier mod = (Modifier) enum_.nextElement(); |
|
422 |
Object v = modifiers.get(mod); |
|
423 |
System.out.print(sep); |
|
424 |
System.out.print(mod.getAbbreviatedModifierDescription(v)); |
|
425 |
sep = ", "; |
|
426 |
} |
|
427 |
System.out.println(); |
|
428 |
} |
|
429 |
} |
|
430 |
||
431 |
public void write(PrintWriter pw) { |
|
432 |
pw.println(" <result "+ |
|
433 |
"num-reps=\""+getRepsPerRun()+"\" "+ |
|
434 |
"num-units=\""+getUnitsPerRep()+"\" "+ |
|
435 |
"name=\""+test.getTreeName()+"\">"); |
|
436 |
Enumeration enum_ = modifiers.keys(); |
|
437 |
while (enum_.hasMoreElements()) { |
|
438 |
Modifier mod = (Modifier) enum_.nextElement(); |
|
439 |
Object v = modifiers.get(mod); |
|
440 |
String val = mod.getModifierValueName(v); |
|
441 |
pw.println(" <option "+ |
|
442 |
"key=\""+mod.getTreeName()+"\" "+ |
|
443 |
"value=\""+val+"\"/>"); |
|
444 |
} |
|
445 |
for (int i = 0; i < getNumRuns(); i++) { |
|
446 |
pw.println(" <time value=\""+getTime(i)+"\"/>"); |
|
447 |
} |
|
448 |
pw.println(" </result>"); |
|
449 |
} |
|
450 |
} |