理解 java jvisualVM 中的指标库单元

understand java metric library units in jvisualVM

基本上,我试图理解指标 java 库

OneMinuteRateRateUnit

所以我已经使用 jmeter 通过 51 个请求访问了服务器 login 方法,现在我正在尝试理解数据。

1 COUNT 给出方法被调用的总次数。

但是 oneMinRaterateUnit 是什么? 这里的事件是什么?


编辑 也请阐明其他属性

指标库对此有一些很好的文档。从您的输出来看,您似乎在代码中使用了 TimerFrom the docs,您可以看到一个计时器 "is basically a histogram of the duration of a type of event and a meter of the rate of its occurrence." 请注意,这些文档提供了 Meter 和直方图的链接。

从这些文档中我们看到,"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."

并且,"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."

因此,将所有这些放在一起并查看您粘贴的内容我们知道:

  • 您的登录码总共被点击了78次
  • 在最后一分钟、5 分钟和 15 分钟内代码被命中 0 times/second(我们知道它是 events/second 因为 RateUnit)
  • 计时器启动和停止之间的中间时间(您必须查看代码以了解计时器停止的位置,以查看实际测量的内容)是 0.286543 毫秒(我们知道单位是毫秒,因为DurationUnit)
  • 第 99 个百分位数时间(例如,99% 的所有调用花费的时间比这个少)是 10.449777 毫秒
  • 等等

上面唯一棘手且定义不明确的是关于费率的项目符号 #2。如文档中所述,这些是 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.