【发布时间】:2012-08-14 02:52:41
【问题描述】:
我将在垃圾收集中花费的时间发送给 Graphite(通过 jmx 从 jvm 获取)。这是一个增加的计数器。他们有办法让 Graphite 每分钟绘制一次变化图表,这样我就可以看到一个图表,显示每分钟在 GC 中花费的时间?
【问题讨论】:
标签: graphite
我将在垃圾收集中花费的时间发送给 Graphite(通过 jmx 从 jvm 获取)。这是一个增加的计数器。他们有办法让 Graphite 每分钟绘制一次变化图表,这样我就可以看到一个图表,显示每分钟在 GC 中花费的时间?
【问题讨论】:
标签: graphite
您应该能够使用 Derivative 函数将计数器变为命中率,然后使用 summarise 函数将计数器变为您之后的时间范围。
&target=summarize(derivative(java.gc_time), "1min") # time spent per minute
导数(系列列表)
This is the opposite of the integral function. This is useful for taking a
running totalmetric and showing how many requests per minute were handled.
&target=derivative(company.server.application01.ifconfig.TXPackets)
每次运行 ifconfig 时,RX 和 TXPacket 都会更高(假设有网络流量。) 通过应用导数函数,您可以了解每分钟发送或接收的数据包,即使您只记录总数。
summarize(seriesList, intervalString, func='sum', alignToFrom=False)
Summarize the data into interval buckets of a certain size.
By default, the contents of each interval bucket are summed together.
This is useful for counters where each increment represents a discrete event and
retrieving a “per X” value requires summing all the events in that interval.
【讨论】:
derivative() 在没有帮助的情况下将无法正常工作。您应该添加keepLastValue,例如:derivative(keepLastValue())
nonNegativeDerivative() 而不是derivative(),它会在进程重新启动时过滤掉原本巨大的峰值(即重置为0)。参考http://www.jilles.net/perma/2013/08/22/how-to-do-graphite-derivatives-correctly/