關(guān)于graphite的幾個function

關(guān)于graphite的幾個function

scale

相當(dāng)于乘法.比如15,scale(10)之后是150,sacle(10)之后是-150

Takes one metric or a wildcard seriesList followed by a constant, and multiplies the datapoint by the constant provided at each point.

scaleToSeconds

比如9,scaleToSeconds(60)=54(比如默認(rèn)是10s采樣一次)

Takes one metric or a wildcard seriesList and returns “value per seconds” where seconds is a last argument to this functions.Useful in conjunction with derivative or integral function if you want to normalize its result to a known resolution for arbitrary retentions

derivative

“導(dǎo)數(shù)”的概念,求變化值,不根據(jù)時間規(guī)范化,比如原來是56,后來是9,那么變化就是-47

This is the opposite of the integral function. This is useful for taking a running total metric and calculating the delta between subsequent data points.This function does not normalize for periods of time, as a true derivative would.

nonNegativeDerivative

非負(fù)求導(dǎo)數(shù),比如原來是56,后來是9,那么差值為-47,為負(fù)數(shù)會被忽略掉。但是可以給nonNegativeDerivative傳參數(shù),比如nonNegativeDerivative(100)就相當(dāng)于-47+100+1=54

Same as the derivative function above, but ignores datapoints that trend down. Useful for counters that increase for a long time, then wrap or reset. (Such as if a network interface is destroyed and recreated by unloading and re-loading a kernel module, common with USB / WiFi cards.)

integral

“積分”的概念,相當(dāng)于不斷累加值

This will show the sum over time, sort of like a continuous addition function. Useful for finding totals or trends in metrics that are collected per minute.

persecond

相當(dāng)于scaleToSeconds(nonNegativeDerivative(metric),1)

NonNegativeDerivative adjusted for the series time interval This is useful for taking a running total metric and showing how many requests per second were handled.
該操作對于累積的counter metric非常有用,可以算出每秒的變動值,比如

count-persecond.png

加上persecond之后就可以把累積的count值轉(zhuǎn)換為變化的曲線

doc

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容