2012-08-17 60 views
14

我发送Graphite垃圾收集所花的时间(通过jmx从jvm获取)。这是一个增加的计数器。他们是否有办法让Graphite每分钟绘制一次更改,以便我可以看到一张显示每分钟花在GC上的时间的图表?石墨:显示以前的值变化

回答

19

您应该能够将计数器转换为具有微分函数的命中率,然后使用汇总函数将计数器转换为您之后的时间范围。

&target=summarize(derivative(java.gc_time), "1min") # time spent per minute 

衍生物(seriesList)

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和TXPackets较高(假设网络流量。) 通过应用衍生功能,就可以得到每分钟发送或接收数据包的想法,即使您只记录总数。

总结(seriesList,intervalString,FUNC = '和',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. 

来源:http://graphite.readthedocs.org/en/0.9.10/functions.html

+0

可不知何故,我每次使用类似上述的第二数值得到什么? – gyre 2013-01-09 01:42:39

+0

现在的问题是如果存储模式设置为存储1个数据点,我们可以说30秒。 – gyre 2013-01-14 17:38:22

+12

另外,如果您的数据为空值,那么'derivative()'在没有帮助的情况下将无法正常工作。您应该添加'keepLastValue',例如:'derivative(keepLastValue())' – 2013-07-25 00:25:18