mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
Add a timestamp on each report saying when it was generated
Not currently used in the code, but useful when troubleshooting.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/armon/go-metrics"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/weaveworks/common/mtime"
|
||||
"golang.org/x/time/rate"
|
||||
|
||||
"github.com/weaveworks/scope/report"
|
||||
@@ -185,6 +186,7 @@ func (p *Probe) report() report.Report {
|
||||
}
|
||||
|
||||
result := report.MakeReport()
|
||||
result.TS = mtime.Now()
|
||||
for i := 0; i < cap(reports); i++ {
|
||||
result.UnsafeMerge(<-reports)
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ func TestProbe(t *testing.T) {
|
||||
node := report.MakeNodeWith("a", map[string]string{"b": "c"})
|
||||
|
||||
want.Endpoint.AddNode(node)
|
||||
want.TS = now
|
||||
|
||||
pub := mockPublisher{make(chan report.Report, 10)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user