scale

相当于乘法.比如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(比如默认是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

“导数”的概念,求变化值,不根据时间规范化,比如原来是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

非负求导数,比如原来是56,后来是9,那么差值为-47,为负数会被忽略掉。但是可以给nonNegativeDerivative传参数,比如nonNegativeDerivative(100)就相当于-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

“积分”的概念,相当于不断累加值

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

相当于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


codecraft
11.9k 声望2k 粉丝

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很自豪告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅,那是个很疯狂的时代,我在一波波的浪潮上留下...


引用和评论

0 条评论