forked from TrueCloudLab/frostfs-node
[#374] Add inner-ring event metrics
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
parent
8dcd06c587
commit
ebcc8afbee
27 changed files with 287 additions and 113 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/metrics"
|
||||
frostfscontract "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/frostfs"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
|
||||
balanceEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event/balance"
|
||||
|
@ -32,6 +33,7 @@ type (
|
|||
// Processor of events produced by balance contract in the morphchain.
|
||||
Processor struct {
|
||||
log *logger.Logger
|
||||
metrics metrics.Register
|
||||
pool *ants.Pool
|
||||
frostfsClient FrostFSClient
|
||||
balanceSC util.Uint160
|
||||
|
@ -42,6 +44,7 @@ type (
|
|||
// Params of the processor constructor.
|
||||
Params struct {
|
||||
Log *logger.Logger
|
||||
Metrics metrics.Register
|
||||
PoolSize int
|
||||
FrostFSClient FrostFSClient
|
||||
BalanceSC util.Uint160
|
||||
|
@ -72,8 +75,14 @@ func New(p *Params) (*Processor, error) {
|
|||
return nil, fmt.Errorf("ir/balance: can't create worker pool: %w", err)
|
||||
}
|
||||
|
||||
metricsRegister := p.Metrics
|
||||
if metricsRegister == nil {
|
||||
metricsRegister = metrics.DefaultRegister{}
|
||||
}
|
||||
|
||||
return &Processor{
|
||||
log: p.Log,
|
||||
metrics: metricsRegister,
|
||||
pool: pool,
|
||||
frostfsClient: p.FrostFSClient,
|
||||
balanceSC: p.BalanceSC,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue