0

I'm trying to parse the JMeter log in the Jenkins console with groovy postbuild. But I want the last line only, since that gives the average req/sec for all the connections. (Example: summary = 2 in 1s = 3.0/s Avg: 107 Min: 56 Max: 159 Err: 0 (0.00%))

But my current groovy postbuild script just picks the first hit in the console. What I want is the same as what I would get if the console searched was started from the end. (reverse) I.e. the last match in the console.

Current:

def summary_matcher = manager.getLogMatcher(".summary = (.)(.Err:)(.*)\$")

manager.addShortText(summary_matcher.group(1)[0..-1] + .......)

And I cannot improve the summary pattern to just pick the final line...

1 Answers1

0

Have you tried looping the result or something similar: How to get multiple regex matches in Java?

Api doc for Matcher: http://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html

Find the last match with Java regex matcher

Community
  • 1
  • 1
MaTePe
  • 936
  • 1
  • 6
  • 11