Skip to content

Commit

Permalink
metrics: adjust the parse & compile duration metrics (pingcap#9925)
Browse files Browse the repository at this point in the history
From current observation, parse cost more than 160us in general,
and compile may take long if it involves subquery or allocate table ID.
Adjust related metrics to be more accurate.
  • Loading branch information
tiancaiamao authored Mar 28, 2019
1 parent 2602977 commit 5c7e70e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions metrics/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ var (
Subsystem: "session",
Name: "parse_duration_seconds",
Help: "Bucketed histogram of processing time (s) in parse SQL.",
Buckets: prometheus.LinearBuckets(0.00004, 0.00001, 13),
Buckets: prometheus.ExponentialBuckets(0.00004, 1.6, 13), // 40us ~ 18ms
}, []string{LblSQLType})
SessionExecuteCompileDuration = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "tidb",
Subsystem: "session",
Name: "compile_duration_seconds",
Help: "Bucketed histogram of processing time (s) in query optimize.",
Buckets: prometheus.LinearBuckets(0.00004, 0.00001, 13),
// Build plan may execute the statement, or allocate table ID, so it might take a long time.
Buckets: prometheus.ExponentialBuckets(0.00004, 2, 13), // 40us ~ 327ms
}, []string{LblSQLType})
SessionExecuteRunDuration = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Expand Down

0 comments on commit 5c7e70e

Please sign in to comment.