Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
enoch
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
enoch
Commits
15fc5a6c
Commit
15fc5a6c
authored
Dec 04, 2019
by
jingbo.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复连续查询SQL问题
parent
2e020fdb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
dbinit.go
pkg/dao/dbinit.go
+3
-3
global.go
pkg/global/global.go
+1
-1
No files found.
pkg/dao/dbinit.go
View file @
15fc5a6c
...
...
@@ -15,17 +15,17 @@ const (
//样本总数:request的总量
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)秒
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 `
+
`GROUP BY 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 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 `
+
`GROUP BY time(1m) fill(0) END;`
...
...
pkg/global/global.go
View file @
15fc5a6c
...
...
@@ -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"
))
Logger
=
logger
.
New
(
logPath
,
logLevel
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment