Make the collector's report IDs a hash of the merged in report.

This commit is contained in:
Tom Wilkie
2016-01-26 16:03:34 -08:00
parent 0e3e3b74f8
commit 57f5a8bb04

View File

@@ -1,9 +1,12 @@
package app
import (
"fmt"
"sync"
"time"
"github.com/spaolacci/murmur3"
"github.com/weaveworks/scope/report"
)
@@ -97,9 +100,12 @@ func (c *collector) Report() report.Report {
c.reports = clean(c.reports, c.window)
rpt := report.MakeReport()
id := murmur3.New64()
for _, tr := range c.reports {
rpt = rpt.Merge(tr.report)
id.Write([]byte(tr.report.ID))
}
rpt.ID = fmt.Sprintf("%x", id.Sum64())
return rpt
}