collect process metrics (#1051)

*  collect process metrics

* collect process metrics in a different goroutine
This commit is contained in:
Andrea Franz 2018-06-25 17:21:04 +02:00 committed by GitHub
parent 5bbfabde94
commit 385f3b3377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -10,10 +10,12 @@ import (
"os/signal" "os/signal"
"runtime" "runtime"
"strings" "strings"
"time"
"github.com/status-im/status-go/logutils" "github.com/status-im/status-go/logutils"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
gethmetrics "github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/p2p/discv5" "github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/status-im/status-go/api" "github.com/status-im/status-go/api"
"github.com/status-im/status-go/cmd/statusd/debug" "github.com/status-im/status-go/cmd/statusd/debug"
@ -150,6 +152,7 @@ func main() {
// Run stats server. // Run stats server.
if *metrics { if *metrics {
go startCollectingNodeMetrics(interruptCh, backend.StatusNode()) go startCollectingNodeMetrics(interruptCh, backend.StatusNode())
go gethmetrics.CollectProcessMetrics(3 * time.Second)
} }
// Sync blockchain and stop. // Sync blockchain and stop.