satellite/metabase/rangedloop: save observer durations to eventkit
Change-Id: I2d027cd7f7421e2c38dcc1277d640d4183af4cec
This commit is contained in:
parent
4e70ef83fb
commit
dfe3c87b87
@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/jtolio/eventkit"
|
||||
"github.com/spacemonkeygo/monkit/v3"
|
||||
)
|
||||
|
||||
@ -16,6 +17,12 @@ var (
|
||||
)
|
||||
|
||||
func sendObserverDurations(observerDurations []ObserverDuration) {
|
||||
for _, od := range observerDurations {
|
||||
ev.Event("rangedloop",
|
||||
eventkit.String("observer", fmt.Sprintf("%T", od.Observer)),
|
||||
eventkit.Duration("duration", od.Duration))
|
||||
}
|
||||
|
||||
completedObserverStatsInstance.setObserverDurations(observerDurations)
|
||||
completedObserverStatsInstanceInitOnce.Do(func() {
|
||||
mon.Chain(&completedObserverStatsInstance)
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/jtolio/eventkit"
|
||||
"github.com/spacemonkeygo/monkit/v3"
|
||||
"github.com/zeebo/errs"
|
||||
"go.uber.org/zap"
|
||||
@ -19,6 +20,7 @@ import (
|
||||
|
||||
var (
|
||||
mon = monkit.Package()
|
||||
ev = eventkit.Package()
|
||||
)
|
||||
|
||||
// Config contains configurable values for the shared loop.
|
||||
|
Loading…
Reference in New Issue
Block a user