Skip to content

Commit

Permalink
Proving opts metrics (#4726)
Browse files Browse the repository at this point in the history
## Motivation
Add public metrics with smeshing proving opts - nonces and threads.
  • Loading branch information
poszu committed Jul 19, 2023
1 parent 43986af commit ed9933a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions metrics/public/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,14 @@ var (
Namespace: "smh",
Name: "version",
}, []string{"version"})

SmeshingOptsProvingNonces = promauto.With(Registry).NewGaugeVec(prometheus.GaugeOpts{
Namespace: "smh",
Name: "smeshing_opts_proving_nonces",
}, []string{}).WithLabelValues()

SmeshingOptsProvingThreads = promauto.With(Registry).NewGaugeVec(prometheus.GaugeOpts{
Namespace: "smh",
Name: "smeshing_opts_proving_threads",
}, []string{}).WithLabelValues()
)
2 changes: 2 additions & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ func (app *App) Initialize() error {
app.introduction()

public.Version.WithLabelValues(cmd.Version).Set(1)
public.SmeshingOptsProvingNonces.Set(float64(app.Config.SMESHING.ProvingOpts.Nonces))
public.SmeshingOptsProvingThreads.Set(float64(app.Config.SMESHING.ProvingOpts.Threads))
return nil
}

Expand Down

0 comments on commit ed9933a

Please sign in to comment.