Close #566. Add some timing data to the logs
parent
a047866420
commit
ad85345e3e
|
@ -12,6 +12,7 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
log "code.google.com/p/log4go"
|
||||
)
|
||||
|
@ -65,7 +66,10 @@ func NewCoordinatorImpl(config *configuration.Configuration, raftServer ClusterC
|
|||
}
|
||||
|
||||
func (self *CoordinatorImpl) RunQuery(user common.User, database string, queryString string, seriesWriter SeriesWriter) (err error) {
|
||||
log.Info("Query: db: %s, u: %s, q: %s", database, user.GetName(), queryString)
|
||||
log.Info("Start Query: db: %s, u: %s, q: %s", database, user.GetName(), queryString)
|
||||
defer func(t time.Time) {
|
||||
log.Debug("End Query: db: %s, u: %s, q: %s, t: %f", database, user.GetName(), queryString, time.Now().Sub(t))
|
||||
}(time.Now())
|
||||
// don't let a panic pass beyond RunQuery
|
||||
defer common.RecoverFunc(database, queryString, nil)
|
||||
|
||||
|
|
Loading…
Reference in New Issue