jdk-24/test/jdk/sun/tools/jstat/lineCounts4.awk
Paul Hohensee 51b7c76a95 8245129: Enhance jstat gc option output and tests
Widen and right-justify size fields assuming 2tb heap

Reviewed-by: simonis, dtitov
2020-06-29 13:39:35 -07:00

63 lines
3.5 KiB
Awk

#
# matching the following output specified as a pattern that verifies
# that the numerical values conform to a specific pattern, rather than
# specific values.
#
# -gcutil -h 10 0 250 11
#
# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT
# 0.00 0.00 57.14 47.16 97.09 92.27 5 0.283 51 23.751 2 0.068 24.102
#
# -J-XX:+UseParallelGC -gcutil -h 10 0 250 11
#
# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT
# 0.00 100.00 46.57 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
# 0.00 100.00 46.57 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
# 0.00 100.00 48.53 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
# 0.00 100.00 48.53 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
# 0.00 100.00 50.49 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
# 0.00 100.00 50.49 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
# 0.00 100.00 52.45 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
# 0.00 100.00 52.45 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
# 0.00 100.00 54.41 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
# 0.00 100.00 54.41 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT
# 0.00 100.00 56.37 14.56 94.70 89.25 5 0.206 0 0.000 - - 0.206
BEGIN {
headerlines=0; datalines=0; totallines=0
datalines2=0;
}
/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ {
headerlines++;
}
/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+|-)[ ]*([0-9]+\.[0-9]+|-)[ ]*[0-9]+\.[0-9]+$/ {
if (headerlines == 2) {
datalines2++;
}
datalines++;
}
{ totallines++; print $0 }
END {
if ((headerlines == 2) && (datalines == 11) && (datalines2 == 1)) {
exit 0
} else {
exit 1
}
}