From 4ebb6c213bacc52f9d4f20a69893db5d6f24a774 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Mon, 28 Nov 2022 12:36:44 -0500 Subject: [PATCH] use NopMetrics by default in store --- state/store.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/state/store.go b/state/store.go index 1f4650e50..3a174d103 100644 --- a/state/store.go +++ b/state/store.go @@ -91,14 +91,23 @@ type StoreOptions struct { // the store will maintain only the response object from the latest // height. DiscardABCIResponses bool + + // Metrics defines the metrics collector to use for the state store. + // if none is specified then a NopMetrics collector is used. + Metrics *Metrics } var _ Store = (*dbStore)(nil) // NewStore creates the dbStore of the state pkg. func NewStore(db dbm.DB, options StoreOptions) Store { + m := NopMetrics() + if options.Metrics != nil { + m = options.Metrics + } return dbStore{ db: db, + metrics: m, StoreOptions: options, } }