mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-14 07:53:47 +00:00
metric storage_capacity
This commit is contained in:
parent
c5d13e4b74
commit
d1b5606b00
1 changed files with 9 additions and 0 deletions
|
|
@ -42,6 +42,10 @@ import (
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
storageCapacity metrics.Gauge
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
privateKeyFileName = "clientKey"
|
privateKeyFileName = "clientKey"
|
||||||
)
|
)
|
||||||
|
|
@ -124,6 +128,11 @@ func shisui(ctx *cli.Context) error {
|
||||||
// Start system runtime metrics collection
|
// Start system runtime metrics collection
|
||||||
go metrics.CollectProcessMetrics(3 * time.Second)
|
go metrics.CollectProcessMetrics(3 * time.Second)
|
||||||
|
|
||||||
|
if metrics.Enabled {
|
||||||
|
storageCapacity = metrics.NewRegisteredGauge("portal/storage_capacity", nil)
|
||||||
|
storageCapacity.Update(ctx.Int64(utils.PortalDataCapacityFlag.Name))
|
||||||
|
}
|
||||||
|
|
||||||
config, err := getPortalConfig(ctx)
|
config, err := getPortalConfig(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue