關於graphite的幾個function

scale

至關於乘法.好比15,scale(10)以後是150,sacle(10)以後是-150html

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

scaleToSeconds

好比9,scaleToSeconds(60)=54(好比默認是10s採樣一次)this

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 retentionsspa

derivative

「導數」的概念,求變化值,不根據時間規範化,好比原來是56,後來是9,那麼變化就是-47.net

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.orm

nonNegativeDerivative

非負求導數,好比原來是56,後來是9,那麼差值爲-47,爲負數會被忽略掉。可是能夠給nonNegativeDerivative傳參數,好比nonNegativeDerivative(100)就至關於-47+100+1=54htm

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.)blog

integral

「積分」的概念,至關於不斷累加值圖片

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.ip

persecond

至關於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值轉換爲變化的曲線

doc

相關文章
相關標籤/搜索