Add basic metrics to the indexer package. (#7250)

This follows the same model as we did in the p2p package.

Rework the indexer service constructor to take a struct of arguments,
that makes it easier to construct the optional settings.
Deprecate but do not remove the existing constructor.

Clean up node initialization a little bit.
This commit is contained in:
M. J. Fromberger
2021-11-05 12:50:53 -07:00
committed by GitHub
parent 54d7030510
commit d5865af1f4
6 changed files with 143 additions and 24 deletions
+2 -1
View File
@@ -558,7 +558,8 @@ func TestNodeSetEventSink(t *testing.T) {
require.NoError(t, err)
indexService, eventSinks, err := createAndStartIndexerService(cfg,
config.DefaultDBProvider, eventBus, logger, genDoc.ChainID)
config.DefaultDBProvider, eventBus, logger, genDoc.ChainID,
indexer.NopMetrics())
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, indexService.Stop()) })
return eventSinks