open-falcon / falcon-plus

An open-source and enterprise-level monitoring system.
Apache License 2.0
7.26k stars 1.53k forks source link

请问历史数据中,consol_fun对应的min、average、max取值规则是什么? #932

Closed shuish0071 closed 3 years ago

shuish0071 commented 3 years ago

对于同一个监控项,如cpu.busy,同一时段内consol_fun对应的min、average、max这三个历史数据都不太一样, (1)请问采集数据的时候是按照min、average、max取三个值进行上报吗? (2)还是说agent只上报1个值,但是经过了服务器的处理,变成三个? (3)如果是只取一个值,那么哪个值能反映真实负载?

如能解惑,十分感谢!

下面是对应数据:

[{'endpoint': '10.19.1.99', 'counter': 'cpu.busy', 'dstype': 'GAUGE', 'step': 120, 'Values': [{'timestamp': 1623132000, 'value': 0.0}, {'timestamp': 1623132600, 'value': 0.0}, {'timestamp': 1623133200, 'value': 0.0}, {'timestamp': 1623133800, 'value': 0.0}, {'timestamp': 1623134400, 'value': 0.0}, {'timestamp': 1623135000, 'value': 0.0}, {'timestamp': 1623135600, 'value': 0.0}]}]

[{'endpoint': '10.19.1.99', 'counter': 'cpu.busy', 'dstype': 'GAUGE', 'step': 120, 'Values': [{'timestamp': 1623132000, 'value': 0.0}, {'timestamp': 1623132600, 'value': 0.155812}, {'timestamp': 1623133200, 'value': 0.018692}, {'timestamp': 1623133800, 'value': 0.168217}, {'timestamp': 1623134400, 'value': 0.0}, {'timestamp': 1623135000, 'value': 0.204723}, {'timestamp': 1623135600, 'value': 0.024905}]}]

[{'endpoint': '10.19.1.99', 'counter': 'cpu.busy', 'dstype': 'GAUGE', 'step': 120, 'Values': [{'timestamp': 1623132000, 'value': 0.0}, {'timestamp': 1623132600, 'value': 0.779059}, {'timestamp': 1623133200, 'value': 0.031153}, {'timestamp': 1623133800, 'value': 0.778816}, {'timestamp': 1623134400, 'value': 0.0}, {'timestamp': 1623135000, 'value': 0.872274}, {'timestamp': 1623135600, 'value': 0.093371}]}]

shuish0071 commented 3 years ago

好吧,自己搞清楚了。 rrd数据库中,在存储的时候有4个方法:min,max,average,last,这里用到前三个。openfalcon的agent在存储的时候,默认average是根据自定义步长监控上报的数值,如1分钟上报一次,这个值就是average,默认10分钟内最大的值就是max,最小的值就是min。 所以想要真实负载就看average。

[test ~/open-falcon/data/6070/ff]# rrdtool fetch ffff75c0d73e928d40245a04927553af_GAUGE_120.rrd AVERAGE --start 1623409200 metric

1623409320: 4.3000000000e-01 1623409440: 1.9000000000e-01 1623409560: 1.6000000000e-01 1623409680: 1.0000000000e-01 1623409800: 2.6000000000e-01 1623409920: 1.8000000000e-01 1623410040: 1.7000000000e-01 1623410160: 2.1000000000e-01 1623410280: 1.6000000000e-01 1623410400: 2.9000000000e-01

[test ~/open-falcon/data/6070/ff]# rrdtool fetch ffff75c0d73e928d40245a04927553af_GAUGE_120.rrd MIN --start 1623409200 metric

1623409800: 1.0000000000e-01 1623410400: 1.6000000000e-01

[test ~/open-falcon/data/6070/ff]# rrdtool fetch ffff75c0d73e928d40245a04927553af_GAUGE_120.rrd MAX --start 1623409200 metric

1623409800: 4.3000000000e-01 1623410400: 2.9000000000e-01