2012-08-17 41 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