Skip to content

Commit

Permalink
Merge pull request #203 from r4f4ss/metrics_ethstats
Browse files Browse the repository at this point in the history
[WIP] Metrics implementation
  • Loading branch information
r4f4ss authored Oct 22, 2024
2 parents 5d315f8 + 4935166 commit 95c2637
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cmd/shisui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ import (
"github.com/urfave/cli/v2"
)

var (
storageCapacity metrics.Gauge
)

const (
privateKeyFileName = "clientKey"
)
Expand Down Expand Up @@ -124,6 +128,11 @@ func shisui(ctx *cli.Context) error {
// Start system runtime metrics collection
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)
if err != nil {
return nil
Expand Down
Loading

0 comments on commit 95c2637

Please sign in to comment.