Skip to content

Commit ff9b0be

Browse files
committed
checkCPUResults() fixed - FlatProfileContainer.getPercentAtRow() is no longer available
1 parent 844694d commit ff9b0be

File tree

1 file changed

+8
-1
lines changed
  • visualvm/libs.profiler/lib.profiler/test/qa-functional/src/org/graalvm/visualvm/lib/jfluid/tests/jfluid/cpu

1 file changed

+8
-1
lines changed

visualvm/libs.profiler/lib.profiler/test/qa-functional/src/org/graalvm/visualvm/lib/jfluid/tests/jfluid/cpu/CPUTestCase.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,18 @@ protected double getError(int invocations, long mctime, long idealtime) {
152152
return Math.abs(ideal - mctime) / 1000;
153153
}
154154

155+
protected double getPercentAtRow(FlatProfileContainer fpc, int row) {
156+
double wholeNetTime = fpc.getWholeGraphNetTime0();
157+
long tm = fpc.getTimeInMcs0AtRow(row);
158+
159+
return ((double)tm / wholeNetTime * 100);
160+
}
161+
155162
protected void checkCPUResults(FlatProfileContainer fpc, HashMap methods, String[] measuredMethodsFilter) {
156163
double percent = 0.0;
157164

158165
for (int row = 0; row < fpc.getNRows(); row++) {
159-
percent += fpc.getPercentAtRow(row);
166+
percent += getPercentAtRow(fpc, row);
160167

161168
for (String measuredMethodsFilter1 : measuredMethodsFilter) {
162169
if (fpc.getMethodNameAtRow(row).startsWith(measuredMethodsFilter1)) {

0 commit comments

Comments
 (0)