[#374] Add inner-ring event metrics
All checks were successful
ci/woodpecker/push/pre-commit Pipeline was successful
All checks were successful
ci/woodpecker/push/pre-commit Pipeline was successful
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
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
containercore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/metrics"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/frostfsid"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
|
||||
containerEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event/container"
|
||||
|
@ -40,6 +41,7 @@ type (
|
|||
// Processor of events produced by container contract in the sidechain.
|
||||
Processor struct {
|
||||
log *logger.Logger
|
||||
metrics metrics.Register
|
||||
pool *ants.Pool
|
||||
alphabetState AlphabetState
|
||||
cnrClient ContClient // notary must be enabled
|
||||
|
@ -51,6 +53,7 @@ type (
|
|||
// Params of the processor constructor.
|
||||
Params struct {
|
||||
Log *logger.Logger
|
||||
Metrics metrics.Register
|
||||
PoolSize int
|
||||
AlphabetState AlphabetState
|
||||
ContainerClient ContClient
|
||||
|
@ -102,8 +105,14 @@ func New(p *Params) (*Processor, error) {
|
|||
return nil, fmt.Errorf("ir/container: 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,
|
||||
alphabetState: p.AlphabetState,
|
||||
cnrClient: p.ContainerClient,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue