diff --git a/cmd/swarm/swarm-smoke/feed_upload_and_sync.go b/cmd/swarm/swarm-smoke/feed_upload_and_sync.go index dec354c06b..9d01c29a6f 100644 --- a/cmd/swarm/swarm-smoke/feed_upload_and_sync.go +++ b/cmd/swarm/swarm-smoke/feed_upload_and_sync.go @@ -16,6 +16,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/swarm/storage/feed" colorable "github.com/mattn/go-colorable" "github.com/pborman/uuid" @@ -27,7 +28,7 @@ const ( ) func cliFeedUploadAndSync(c *cli.Context) error { - feedUploadAndSyncCount.Inc(1) + metrics.GetOrRegisterCounter("feed-and-sync", nil).Inc(1) log.Root().SetHandler(log.CallerFileHandler(log.LvlFilterHandler(log.Lvl(verbosity), log.StreamHandler(colorable.NewColorableStderr(), log.TerminalFormat(true))))) errc := make(chan error) @@ -38,11 +39,11 @@ func cliFeedUploadAndSync(c *cli.Context) error { select { case err := <-errc: if err != nil { - feedUploadAndSyncFailCount.Inc(1) + metrics.GetOrRegisterCounter("feed-and-sync.fail", nil).Inc(1) } return err case <-time.After(time.Duration(timeout) * time.Second): - feedUploadAndSyncTimeout.Inc(1) + metrics.GetOrRegisterCounter("feed-and-sync.timeout", nil).Inc(1) return fmt.Errorf("timeout after %v sec", timeout) } } diff --git a/cmd/swarm/swarm-smoke/main.go b/cmd/swarm/swarm-smoke/main.go index f6e489df8a..bf0d4762ed 100644 --- a/cmd/swarm/swarm-smoke/main.go +++ b/cmd/swarm/swarm-smoke/main.go @@ -47,11 +47,6 @@ var ( verbosity int timeout int ) -var ( - feedUploadAndSyncCount = gethmetrics.NewRegisteredCounter("feed-and-sync", nil) - feedUploadAndSyncFailCount = gethmetrics.NewRegisteredCounter("feed-and-sync.fail", nil) - feedUploadAndSyncTimeout = gethmetrics.NewRegisteredCounter("feed-and-sync.timeout", nil) -) func main() {