怀疑 是计数器知会更新 ”服务器下线: null“的,而”服务器下线”这个并没有计数器增加,再来多测试几次
这次,先准备一个脚本
#!/bin/bash
for x in `seq 1 1000`
do
echo "服务器下线: null" >> xcloud-cm.2016-10-17_0.info.log && echo "已插入一条数据"
sleep 1
done
1. 配置文件中,如果把两个地方顺序颠倒,会如何?
2. 如果我们仅仅是把关键字 "服务器下线" 打进去,会如何?
先做第二个,这个简单,可是结果让人有点想不通
上报数据已经是60了,可是图形依旧是不显示, 当然也就没了报警。 那么这个问题就值得回归测试一下,是不是上面其实计数器上报了呢。
#!/bin/bash
for x in `seq 1 1000`
do
#echo "服务器下线: null" >> xcloud-cm.2016-10-17_0.info.log && echo "已插入一条数据"
echo "服务器下线" >> xcloud-cm.2016-10-17_0.info.log && echo "已插入一条数据"
sleep 1
done
* 重复一遍第一个测试,试试logdog在pushdata的时候是多少。可以看到,虽然exp两个都可以exp到,但是最终上报仍旧是一个有数值,另外一个没有数值。
[10/17/16 23:33:27] [DEBG] pushing data: [{"metric":"log","endpoint":"10.0.100.85","timestamp":1476761607,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-private-api,suffix=log,error=closing.socket.connection.and.attempting.reconnect"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476761607,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,nameMachineOffline=."},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476761607,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-dispatcher,suffix=log,error=closing.socket.connection.and.attempting.reconnect"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476761607,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,error=closing.socket.connection.and.attempting.reconnect"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476761549,"value":60,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,error=.null"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476761549,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-private-api,suffix=log,error=closing.socket.connection.and.attempting.reconnect"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476761548,"value":60,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,nameMachineOffline=."}]
我已经晕菜了~~
总结
再来一个实验,这次把 ”服务器下线: null“ 和 ”null“进行对比
[10/17/16 23:40:15] [DEBG] pushing data: [{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762015,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,nameMachineOffline=null"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762015,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-dispatcher,suffix=log,error=closing.socket.connection.and.attempting.reconnect"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762015,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,error=closing.socket.connection.and.attempting.reconnect"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476761955,"value":844,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,error=.null"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476761955,"value":845,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,nameMachineOffline=null"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476761955,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,error=closing.socket.connection.and.attempting.reconnect"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762015,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-private-api,suffix=log,error=closing.socket.connection.and.attempting.reconnect"}]
[abc@ip-10-0-100-85 falcon-logdog]$ ./control tail | grep push
[10/17/16 23:43:15] [DEBG] pushing data: [{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762195,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-private-api,suffix=log,error=closing.socket.connection.and.attempting.reconnect"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762195,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-dispatcher,suffix=log,error=closing.socket.connection.and.attempting.reconnect"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762195,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,nameMachineOffline=null"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762195,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,error=closing.socket.connection.and.attempting.reconnect"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762135,"value":39,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,error=.null"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762141,"value":38,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,nameMachineOffline=null"},{"metric":"log","endpoint":"10.0.100.85","timestamp":1476762135,"value":0,"step":60,"counterType":"GAUGE","tags":"prefix=abc-cm,suffix=log,error=closing.socket.connection.and.attempting.reconnect"}]
看了上面的结果,我有点蒙了, 因为数值出现了800度,这个是不可能的哦。 第二条数据倒是都在38左右,但是怎么多了个指标来。