metrics: set summary unit

we have to use milleseconds since graphite
doesnt support float64
This commit is contained in:
bergquist
2017-09-14 19:28:54 +02:00
parent 5b74bea476
commit 491e6897e7
3 changed files with 10 additions and 9 deletions

View File

@@ -63,8 +63,8 @@ func (e *DefaultEvalHandler) Eval(context *EvalContext) {
context.EndTime = time.Now()
context.Rule.State = e.getNewState(context)
elapsedTime := context.EndTime.Sub(context.StartTime).Seconds()
metrics.M_Alerting_Execution_Time.Observe(elapsedTime)
elapsedTime := context.EndTime.Sub(context.StartTime).Nanoseconds() / int64(time.Millisecond)
metrics.M_Alerting_Execution_Time.Observe(float64(elapsedTime))
}
// This should be move into evalContext once its been refactored.