mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
Make the collector's report IDs a hash of the merged in report.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user