feat(alerting): add exeuction time to alertResult

This commit is contained in:
bergquist
2016-06-23 15:52:45 +02:00
parent f95be63c43
commit 8b05af2f90
5 changed files with 20 additions and 11 deletions
+5 -4
View File
@@ -95,10 +95,11 @@ func (e *Engine) executeJob(job *AlertJob) {
select {
case <-time.After(time.Second * 5):
e.resultQueue <- &AlertResult{
State: alertstates.Pending,
Duration: float64(time.Since(now).Nanoseconds()) / float64(1000000),
Error: fmt.Errorf("Timeout"),
AlertJob: job,
State: alertstates.Pending,
Duration: float64(time.Since(now).Nanoseconds()) / float64(1000000),
Error: fmt.Errorf("Timeout"),
AlertJob: job,
ExeuctionTime: time.Now(),
}
e.log.Debug("Job Execution timeout", "alertRuleId", job.Rule.Id)
case result := <-resultChan: