Skip to content

Commit c8a77d8

Browse files
authored
swarm/metrics: track runtime metrics (#19557)
1 parent 7744241 commit c8a77d8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎swarm/metrics/flags.go‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"time"
2121

2222
"github.com/ethereum/go-ethereum/cmd/utils"
23+
"github.com/ethereum/go-ethereum/metrics"
2324
gethmetrics "github.com/ethereum/go-ethereum/metrics"
2425
"github.com/ethereum/go-ethereum/metrics/influxdb"
2526
"github.com/ethereum/go-ethereum/swarm/log"
@@ -91,7 +92,10 @@ func Setup(ctx *cli.Context) {
9192
)
9293

9394
// Start system runtime metrics collection
94-
go gethmetrics.CollectProcessMetrics(2 * time.Second)
95+
go gethmetrics.CollectProcessMetrics(4 * time.Second)
96+
97+
gethmetrics.RegisterRuntimeMemStats(metrics.DefaultRegistry)
98+
go gethmetrics.CaptureRuntimeMemStats(metrics.DefaultRegistry, 4*time.Second)
9599

96100
tagsMap := utils.SplitTagsFlag(ctx.GlobalString(MetricsInfluxDBTagsFlag.Name))
97101

0 commit comments

Comments
 (0)