From c8a77d8604bd4295e0a0f88b7165e7729be78409 Mon Sep 17 00:00:00 2001
From: Anton Evangelatov <anton.evangelatov@gmail.com>
Date: Mon, 13 May 2019 09:55:11 +0200
Subject: swarm/metrics: track runtime metrics (#19557)

---
 swarm/metrics/flags.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/swarm/metrics/flags.go b/swarm/metrics/flags.go
index d348dc3e4..3e7918b16 100644
--- a/swarm/metrics/flags.go
+++ b/swarm/metrics/flags.go
@@ -20,6 +20,7 @@ import (
 	"time"
 
 	"github.com/ethereum/go-ethereum/cmd/utils"
+	"github.com/ethereum/go-ethereum/metrics"
 	gethmetrics "github.com/ethereum/go-ethereum/metrics"
 	"github.com/ethereum/go-ethereum/metrics/influxdb"
 	"github.com/ethereum/go-ethereum/swarm/log"
@@ -91,7 +92,10 @@ func Setup(ctx *cli.Context) {
 		)
 
 		// Start system runtime metrics collection
-		go gethmetrics.CollectProcessMetrics(2 * time.Second)
+		go gethmetrics.CollectProcessMetrics(4 * time.Second)
+
+		gethmetrics.RegisterRuntimeMemStats(metrics.DefaultRegistry)
+		go gethmetrics.CaptureRuntimeMemStats(metrics.DefaultRegistry, 4*time.Second)
 
 		tagsMap := utils.SplitTagsFlag(ctx.GlobalString(MetricsInfluxDBTagsFlag.Name))
 
-- 
cgit v1.2.3