8343946: JFR: Wildcard should only work with COUNT for 'jfr view'

Reviewed-by: mgronlun
This commit is contained in:
Erik Gahlin 2024-11-12 15:34:50 +00:00
parent 2989d8734c
commit e5eaa7f1eb
2 changed files with 3 additions and 3 deletions

View File

@ -144,7 +144,7 @@ final class QueryResolver {
field.aggregator = expression.aggregator();
FieldBuilder.configureAggregator(field);
expression.alias().ifPresent(alias -> fieldAliases.put(alias, field));
if (field.name.equals("*") && field.aggregator != Aggregator.COUNT) {
if (expression.name().equals("*") && field.aggregator != Aggregator.COUNT) {
throw new QuerySyntaxException("Wildcard ('*') can only be used with aggregator function COUNT");
}
}
@ -259,7 +259,7 @@ final class QueryResolver {
List<Field> fields = new ArrayList<>();
if (name.equals("*")) {
// Used with COUNT(*) and UNIQUE(*)
// Used with COUNT(*)
// All events should have a start time
name = "startTime";
}

View File

@ -178,7 +178,7 @@ table = "COLUMN 'StackTrace', 'Count', 'Avg.', 'Max.'
[application.contention-by-address]
label = "Contention by Monitor Address"
table = "COLUMN 'Monitor Address', 'Class', 'Threads', 'Max Duration'
SELECT address, FIRST(monitorClass), UNIQUE(*), MAX(duration) AS M
SELECT address, FIRST(monitorClass), UNIQUE(eventThread), MAX(duration) AS M
FROM JavaMonitorEnter
GROUP BY monitorClass ORDER BY M"