Commit 15fc5a6c authored by jingbo.wang's avatar jingbo.wang

修复连续查询SQL问题

parent 2e020fdb
...@@ -15,17 +15,17 @@ const ( ...@@ -15,17 +15,17 @@ const (
//样本总数:request的总量 //样本总数:request的总量
ApdexCqAll = `CREATE CONTINUOUS QUERY cq_apdex_all ON monitor RESAMPLE FOR 1h BEGIN ` + ApdexCqAll = `CREATE CONTINUOUS QUERY cq_apdex_all ON monitor RESAMPLE FOR 1h BEGIN ` +
`SELECT count(traceId) AS ct_all INTO apdex FROM trace_info GROUP BY sys_name, time(1m) fill(1) END;` `SELECT count(traceId) AS ct_all INTO monitor.autogen.apdex FROM trace_info GROUP BY sys_name, time(1m) fill(1) END;`
//满意样本:request的响应时间[0, m)秒 //满意样本:request的响应时间[0, m)秒
ApdexCqSat = `CREATE CONTINUOUS QUERY cq_apdex_sat_%s ON monitor RESAMPLE FOR 1h BEGIN ` + ApdexCqSat = `CREATE CONTINUOUS QUERY cq_apdex_sat_%s ON monitor RESAMPLE FOR 1h BEGIN ` +
`SELECT count(traceId) AS sat INTO apdex FROM trace_info ` + `SELECT count(traceId) AS sat INTO monitor.autogen.apdex FROM trace_info ` +
`WHERE sys_name = '%s' AND 'duration' < %d ` + `WHERE sys_name = '%s' AND 'duration' < %d ` +
`GROUP BY time(1m) fill(0) END;` `GROUP BY time(1m) fill(0) END;`
//可容忍样本:request的响应时间[m, n)秒 //可容忍样本:request的响应时间[m, n)秒
ApdexCqTol = `CREATE CONTINUOUS QUERY cq_apdex_tol_%s ON monitor RESAMPLE FOR 1h BEGIN ` + ApdexCqTol = `CREATE CONTINUOUS QUERY cq_apdex_tol_%s ON monitor RESAMPLE FOR 1h BEGIN ` +
`SELECT count(traceId) AS tol INTO apdex FROM trace_info ` + `SELECT count(traceId) AS tol INTO monitor.autogen.apdex FROM trace_info ` +
`WHERE sys_name = '%s' AND 'duration' >= %d AND 'duration' < %d ` + `WHERE sys_name = '%s' AND 'duration' >= %d AND 'duration' < %d ` +
`GROUP BY time(1m) fill(0) END;` `GROUP BY time(1m) fill(0) END;`
......
...@@ -89,7 +89,7 @@ func init() { ...@@ -89,7 +89,7 @@ func init() {
} }
//初始化日志 //初始化日志
logPath := Config.GetOrDefault(NamespaceApplication, "log.dir", "/dev/stdout") logPath := Config.GetOrDefault(NamespaceApplication, "log.path", "/dev/stdout")
logLevel := getLoggerLevel(Config.GetOrDefault(NamespaceApplication, "log.level", "info")) logLevel := getLoggerLevel(Config.GetOrDefault(NamespaceApplication, "log.level", "info"))
Logger = logger.New(logPath, logLevel) Logger = logger.New(logPath, logLevel)
......
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