Skip to content

Commit

Permalink
refactor: switch to using Batching datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
derrandz committed Jan 27, 2023
1 parent 50c1db3 commit 179fd50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nodebuilder/node/uptime.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type UptimeMetrics struct {
totalNodeUptime asyncfloat64.Counter

// store is the datastore used to store the node uptime metrics.
store datastore.Datastore
store datastore.Batching
}

var (
Expand All @@ -40,7 +40,7 @@ var (

// NewUptimeMetrics creates a new UptimeMetrics
// and registers a callback to re-meter the totalNodeUptime metric.
func NewUptimeMetrics(ds datastore.Datastore) (*UptimeMetrics, error) {
func NewUptimeMetrics(ds datastore.Batching) (*UptimeMetrics, error) {
nodeStartTS, err := meter.
AsyncFloat64().
Gauge(
Expand Down
2 changes: 1 addition & 1 deletion nodebuilder/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func WithMetrics(metricOpts []otlpmetrichttp.Option, nodeType node.Type) fx.Opti
fx.Invoke(header.WithMetrics),
fx.Invoke(state.WithMetrics),
fx.Invoke(fraud.WithMetrics),
fx.Invoke(func(ctx context.Context, ds datastore.Datastore) error {
fx.Invoke(func(ctx context.Context, ds datastore.Batching) error {
m, err := node.NewUptimeMetrics(ds)
if err != nil {
return err
Expand Down

0 comments on commit 179fd50

Please sign in to comment.