Commit ac142cb4 authored by jingbo.wang's avatar jingbo.wang

连续查询ok

parent 15fc5a6c
......@@ -15,19 +15,19 @@ const (
//样本总数:request的总量
ApdexCqAll = `CREATE CONTINUOUS QUERY cq_apdex_all ON monitor RESAMPLE FOR 1h BEGIN ` +
`SELECT count(traceId) AS ct_all INTO monitor.autogen.apdex FROM trace_info GROUP BY sys_name, time(1m) fill(1) END;`
`SELECT count(traceId) AS ct_all INTO monitor.autogen.apdex FROM monitor.autogen.trace_info GROUP BY sys_name, time(1m) fill(1) END;`
//满意样本:request的响应时间[0, m)秒
ApdexCqSat = `CREATE CONTINUOUS QUERY cq_apdex_sat_%s ON monitor RESAMPLE FOR 1h BEGIN ` +
`SELECT count(traceId) AS sat INTO monitor.autogen.apdex FROM trace_info ` +
`WHERE sys_name = '%s' AND 'duration' < %d ` +
`GROUP BY time(1m) fill(0) END;`
`SELECT count(traceId) AS sat INTO monitor.autogen.apdex FROM monitor.autogen.trace_info ` +
`WHERE sys_name = '%s' AND "duration" < %d ` +
`GROUP BY sys_name, time(1m) fill(0) END;`
//可容忍样本:request的响应时间[m, n)秒
ApdexCqTol = `CREATE CONTINUOUS QUERY cq_apdex_tol_%s ON monitor RESAMPLE FOR 1h BEGIN ` +
`SELECT count(traceId) AS tol INTO monitor.autogen.apdex FROM trace_info ` +
`WHERE sys_name = '%s' AND 'duration' >= %d AND 'duration' < %d ` +
`GROUP BY time(1m) fill(0) END;`
`SELECT count(traceId) AS tol INTO monitor.autogen.apdex FROM monitor.autogen.trace_info ` +
`WHERE sys_name = '%s' AND "duration" >= %d AND "duration" < %d ` +
`GROUP BY sys_name, time(1m) fill(0) END;`
//获取全部服务
SysNameSql = "show tag values from trace_info with key = sys_name;"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment