Merge pull request #6920 from influxdata/js-6909-log-cq-execution-time
Log the CQ execution time when continuous query logging is enabledpull/7046/head
commit
92825b418f
|
@ -39,6 +39,7 @@ With this release the systemd configuration files for InfluxDB will use the syst
|
|||
- [#1110](https://github.com/influxdata/influxdb/issues/1110): Support loading a folder for collectd typesdb files.
|
||||
- [#6928](https://github.com/influxdata/influxdb/issues/6928): Run continuous query for multiple buckets rather than one per bucket.
|
||||
- [#5500](https://github.com/influxdata/influxdb/issues/5500): Add extra trace logging to tsm engine.
|
||||
- [#6909](https://github.com/influxdata/influxdb/issues/6909): Log the CQ execution time when continuous query logging is enabled.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
|
|
|
@ -324,8 +324,10 @@ func (s *Service) ExecuteContinuousQuery(dbi *meta.DatabaseInfo, cqi *meta.Conti
|
|||
return err
|
||||
}
|
||||
|
||||
var start time.Time
|
||||
if s.loggingEnabled {
|
||||
s.Logger.Printf("executing continuous query %s (%v to %v)", cq.Info.Name, startTime, endTime)
|
||||
start = time.Now()
|
||||
}
|
||||
|
||||
// Do the actual processing of the query & writing of results.
|
||||
|
@ -333,6 +335,10 @@ func (s *Service) ExecuteContinuousQuery(dbi *meta.DatabaseInfo, cqi *meta.Conti
|
|||
s.Logger.Printf("error: %s. running: %s\n", err, cq.q.String())
|
||||
return err
|
||||
}
|
||||
|
||||
if s.loggingEnabled {
|
||||
s.Logger.Printf("finished continuous query %s (%v to %v) in %s", cq.Info.Name, startTime, endTime, time.Now().Sub(start))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue