2020-10-12 10:17:40 +00:00
|
|
|
package alphabet
|
|
|
|
|
|
|
|
import (
|
2024-10-21 07:22:54 +00:00
|
|
|
"context"
|
|
|
|
|
2023-04-12 14:35:10 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
2023-05-26 10:24:41 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors"
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/timers"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
|
2020-10-12 10:17:40 +00:00
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
2021-09-08 08:28:41 +00:00
|
|
|
func (ap *Processor) HandleGasEmission(ev event.Event) {
|
2020-10-12 10:17:40 +00:00
|
|
|
_ = ev.(timers.NewAlphabetEmitTick)
|
2024-10-21 07:22:54 +00:00
|
|
|
ap.log.Info(context.Background(), logs.AlphabetTick, zap.String("type", "alphabet gas emit"))
|
2020-10-12 10:17:40 +00:00
|
|
|
|
|
|
|
// send event to the worker pool
|
|
|
|
|
2023-05-26 10:24:41 +00:00
|
|
|
err := processors.SubmitEvent(ap.pool, ap.metrics, "alphabet_emit_gas", ap.processEmit)
|
2020-10-12 10:17:40 +00:00
|
|
|
if err != nil {
|
|
|
|
// there system can be moved into controlled degradation stage
|
2024-10-21 07:22:54 +00:00
|
|
|
ap.log.Warn(context.Background(), logs.AlphabetAlphabetProcessorWorkerPoolDrained,
|
2021-09-08 08:28:41 +00:00
|
|
|
zap.Int("capacity", ap.pool.Cap()))
|
2020-10-12 10:17:40 +00:00
|
|
|
}
|
|
|
|
}
|