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
|
@ -7,6 +7,7 @@ import (
|
|||
"time"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/metrics"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
|
||||
|
@ -50,6 +51,7 @@ type (
|
|||
// protects parsedWallets from concurrent change
|
||||
pwLock *sync.RWMutex
|
||||
log *logger.Logger
|
||||
metrics metrics.Register
|
||||
pool *ants.Pool
|
||||
alphabetContracts Contracts
|
||||
netmapClient netmapClient
|
||||
|
@ -62,6 +64,7 @@ type (
|
|||
Params struct {
|
||||
ParsedWallets []util.Uint160
|
||||
Log *logger.Logger
|
||||
Metrics metrics.Register
|
||||
PoolSize int
|
||||
AlphabetContracts Contracts
|
||||
NetmapClient netmapClient
|
||||
|
@ -89,10 +92,16 @@ func New(p *Params) (*Processor, error) {
|
|||
return nil, fmt.Errorf("ir/frostfs: can't create worker pool: %w", err)
|
||||
}
|
||||
|
||||
metricsRegister := p.Metrics
|
||||
if metricsRegister == nil {
|
||||
metricsRegister = metrics.DefaultRegister{}
|
||||
}
|
||||
|
||||
return &Processor{
|
||||
parsedWallets: p.ParsedWallets,
|
||||
pwLock: new(sync.RWMutex),
|
||||
log: p.Log,
|
||||
metrics: metricsRegister,
|
||||
pool: pool,
|
||||
alphabetContracts: p.AlphabetContracts,
|
||||
netmapClient: p.NetmapClient,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue