Set the Window duration which each report covers

This is used by the multi-tenant code.
This commit is contained in:
Bryan Boreham
2020-03-06 15:43:54 +00:00
parent 3098267be4
commit 72145dc378

View File

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