Merge pull request #6920 from influxdata/js-6909-log-cq-execution-time

Log the CQ execution time when continuous query logging is enabled
pull/7046/head
Jonathan A. Sternberg 2016-07-21 12:56:03 -05:00 committed by GitHub
commit 92825b418f
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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
}