aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
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
parentb677a07d36c957c4221bae952189559ac0c70537 (diff)
downloaddexon-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar
dexon-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar.gz
dexon-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar.bz2
dexon-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar.lz
dexon-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar.xz
dexon-dcca613a0b4c6ce56e52f4607cf71f4f1338db8f.tar.zst
dexon-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')
-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()