【发布时间】:2018-05-27 08:29:48
【问题描述】:
我使用 CloudLinux 运行共享网络托管。 从中,我可以得到一堆性能指标
所以,我的 influxDB 是:
测量:lve
字段:CPU,EP,IO,IOPS,MEM,MEMPHY,NETI,NETO,NPROC,fEP,fMEM,fMEMPHY,fNPROC,lCPU,lCPUW,lEP,lIO,lIOPS,lMEM,lMEMPHY,lNETI,lNETO,lNPROC ,nCPU
标签:xpool、host、user(其中:xpool 是 xen-pool uid,host 是 cloudLinux 的主机名,user 是共享主机的用户名)
每 5 秒收集一次数据
查询语句如何:
从特定的 xpool+host 中选择记录,并且
得到 5 个唯一的用户名,在 5 分钟内产生 TOP CPU 使用率? 有数百个用户名,但我只想获得前 5 名。
注意:与https://docs.influxdata.com/influxdb/v1.5/query_language/functions/#top 中的 TOP() 示例 4 相同,除非预期结果是:
name: h2o_feet
time top location
---- --- --------
2015-08-18T00:00:00Z 8.12 coyote_creek
2015-08-18T00:54:00Z 2.054 santa_monica
而不是:
name: h2o_feet
time top location
---- --- --------
2015-08-18T00:48:00Z 7.11 coyote_creek
2015-08-18T00:54:00Z 6.982 coyote_creek
2015-08-18T00:54:00Z 2.054 santa_monica
2015-08-18T00:24:00Z 7.635 coyote_creek
2015-08-18T00:30:00Z 7.5 coyote_creek
2015-08-18T00:36:00Z 7.372 coyote_creek
2015-08-18T00:00:00Z 8.12 coyote_creek
2015-08-18T00:06:00Z 8.005 coyote_creek
2015-08-18T00:12:00Z 7.887 coyote_creek
因为“8.12”是“coyote_creek”的最高值,而“2.054”是“santa_monica”的最高值
真诚的
-比诺-
【问题讨论】: