aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/swarm/main.go
diff options
context:
space:
mode:
authorAnton Evangelatov <anton.evangelatov@gmail.com>2018-02-23 21:19:59 +0800
committerBalint Gabor <balint.g@gmail.com>2018-02-23 21:19:59 +0800
commitdcca613a0b4c6ce56e52f4607cf71f4f1338db8f (patch)
tree298e858e042df9d515aa091a79902ee9bf6d9f7b /cmd/swarm/main.go
parentb677a07d36c957c4221bae952189559ac0c70537 (diff)
downloadgo-tangerine-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar
go-tangerine-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar.gz
go-tangerine-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar.bz2
go-tangerine-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar.lz
go-tangerine-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar.xz
go-tangerine-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar.zst
go-tangerine-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.zip
swarm: initial instrumentation (#15969)
* swarm: initial instrumentation with go-metrics * swarm: initialise metrics collection and add ResettingTimer to HTTP requests * swarm: update metrics flags names. remove redundant Timer. * swarm: rename method for periodically updating gauges * swarm: finalise metrics after feedback * swarm/network: always init kad metrics containers * swarm/network: off-by-one index in metrics containers * swarm, metrics: resolved conflicts
Diffstat (limited to 'cmd/swarm/main.go')
-rw-r--r--cmd/swarm/main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go
index 4b0823796..360020b77 100644
--- a/cmd/swarm/main.go
+++ b/cmd/swarm/main.go
@@ -43,6 +43,7 @@ import (
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/swarm"
bzzapi "github.com/ethereum/go-ethereum/swarm/api"
+ swarmmetrics "github.com/ethereum/go-ethereum/swarm/metrics"
"gopkg.in/urfave/cli.v1"
)
@@ -359,9 +360,14 @@ DEPRECATED: use 'swarm db clean'.
DeprecatedEnsAddrFlag,
}
app.Flags = append(app.Flags, debug.Flags...)
+ app.Flags = append(app.Flags, swarmmetrics.Flags...)
app.Before = func(ctx *cli.Context) error {
runtime.GOMAXPROCS(runtime.NumCPU())
- return debug.Setup(ctx)
+ if err := debug.Setup(ctx); err != nil {
+ return err
+ }
+ swarmmetrics.Setup(ctx)
+ return nil
}
app.After = func(ctx *cli.Context) error {
debug.Exit()