understand java metric library units in jvisualVM

394 views Asked by At

Basically i am trying to understand the OneMinuteRate, RateUnit of the metric java library

So i have hit the server login method with 51 request using jmeter and now i am trying to make sense of the data.

1 The COUNT gives the total number of times the method has been called.

But what is the oneMinRate and rateUnit ? and what is event here ?


EDIT Please also throw light on other attributes as well please

enter image description here

1

There are 1 answers

0
Oliver Dain On BEST ANSWER

The metrics library has some pretty good documentation on this. From your output, it appears that you are using a Timer in your code. From the docs, you can see that a Timer "is basically a histogram of the duration of a type of event and a meter of the rate of its occurrence." Note that those docs provide links for both the Meter and the histogram.

From those docs we see that, "Meters measure the rate of the events in a few different ways. The mean rate is the average rate of events. It’s generally useful for trivia, but as it represents the total rate for your application’s entire lifetime (e.g., the total number of requests handled, divided by the number of seconds the process has been running), it doesn’t offer a sense of recency. Luckily, meters also record three different exponentially-weighted moving average rates: the 1-, 5-, and 15-minute moving averages."

and, "Histogram metrics allow you to measure not just easy things like the min, mean, max, and standard deviation of values, but also quantiles like the median or 95th percentile."

So, putting that all together and looking at what you've pasted we know:

  • Your login code has been hit a total of 78 times
  • In the last minute, 5 minutes, and 15 minutes that code has been hit 0 times/second (we know it's events/second because of the RateUnit)
  • The median time between the timer being started and stopped (you'll have to look at the code to see where the timer gets stopped to see what's actually being measured) is 0.286543 milliseconds (we know the unit is milliseconds because of DurationUnit)
  • The 99th percentile time (e.g. 99% of all calls took less time that this) was 10.449777 milliseconds
  • etc.

The only thing that's tricky and not terribly well defined in the above is bullet #2 about the rates. As stated in the docs, these are exponentially weighted moving averages so the 1 minute rate, for example, includes some information about the rate more than 1 minute ago. For the 1-minute rate, the weights in the average have been set so that what matters most is the data in the past minute. That's not terribly clear and the docs don't clarify. For the most part you can just think of these as the rate, in events/second, in the last 1 minute, 5 minutes, and 15 minutes. But if you really need to know the precise definition, you can find the weights that are being used in the source code.