關(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非常有用,可以算出每秒的變動值,比如

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