diff --git a/CHANGELOG.md b/CHANGELOG.md index aea696968e..640c3c52b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/services/continuous_querier/service.go b/services/continuous_querier/service.go index 45cc69902b..377d095595 100644 --- a/services/continuous_querier/service.go +++ b/services/continuous_querier/service.go @@ -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 }