satellite/metabase/rangedloop: save observer durations to eventkit

Change-Id: I2d027cd7f7421e2c38dcc1277d640d4183af4cec
This commit is contained in:
Márton Elek 2023-02-23 14:08:30 +01:00 committed by Storj Robot
parent 4e70ef83fb
commit dfe3c87b87
2 changed files with 9 additions and 0 deletions

View File

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

View File

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