关于graphite的几个function

本文介绍了时间序列数据分析中常用的操作函数,如scale、scaleToSeconds、derivative、nonNegativeDerivative、integral及persecond等,解释了这些函数如何帮助理解数据趋势、变化率以及总量,并特别强调了它们在处理累积计数器指标时的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值