Skip to content

Commit 55bcf4c

Browse files
committedJan 8, 2025
8346047: JFR: Incorrect percentile value in 'jfr view'
Reviewed-by: mgronlun
1 parent ae3fc46 commit 55bcf4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/jdk.jfr/share/classes/jdk/jfr/internal/query/Function.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static Function create(Field field) {
8989
return createPercentile(field, 0.99);
9090
}
9191
if (aggregator == Aggregator.P999) {
92-
return createPercentile(field, 0.9999);
92+
return createPercentile(field, 0.999);
9393
}
9494
if (aggregator == Aggregator.MAXIMUM) {
9595
return new Maximum();
@@ -578,7 +578,7 @@ public Object result() {
578578
double doubleIndex = (size + 1) * percentile;
579579
int valueIndex = (int) doubleIndex - 1;
580580
int valueNextIndex = (int) doubleIndex;
581-
double fraction = doubleIndex - valueIndex;
581+
double fraction = doubleIndex - (int) doubleIndex;
582582

583583
if (valueIndex < 0) {
584584
return numbers.getFirst();

0 commit comments

Comments
 (0)
Please sign in to comment.