From 72145dc37866eff9d1e6ac9c83ace595509e94b1 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 6 Mar 2020 15:43:54 +0000 Subject: [PATCH] Set the Window duration which each report covers This is used by the multi-tenant code. --- probe/probe.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/probe/probe.go b/probe/probe.go index e6d329b45..e54ec6c84 100644 --- a/probe/probe.go +++ b/probe/probe.go @@ -236,6 +236,7 @@ ForLoop: func (p *Probe) publishLoop() { defer p.done.Done() + startTime := mtime.Now() pubTick := time.Tick(p.publishInterval) publishCount := 0 var lastFullReport report.Report @@ -249,6 +250,8 @@ func (p *Probe) publishLoop() { if !fullReport { rpt.UnsafeUnMerge(lastFullReport) } + rpt.Window = mtime.Now().Sub(startTime) + startTime = mtime.Now() err = p.publisher.Publish(rpt) if err == nil { if fullReport {