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
|
@ -13,12 +13,12 @@ import (
|
|||
|
||||
const emitMethod = "emit"
|
||||
|
||||
func (ap *Processor) processEmit() {
|
||||
func (ap *Processor) processEmit() bool {
|
||||
index := ap.irList.AlphabetIndex()
|
||||
if index < 0 {
|
||||
ap.log.Info(logs.AlphabetNonAlphabetModeIgnoreGasEmissionEvent)
|
||||
|
||||
return
|
||||
return true
|
||||
}
|
||||
|
||||
contract, ok := ap.alphabetContracts.GetByIndex(index)
|
||||
|
@ -26,7 +26,7 @@ func (ap *Processor) processEmit() {
|
|||
ap.log.Debug(logs.AlphabetNodeIsOutOfAlphabetRangeIgnoreGasEmissionEvent,
|
||||
zap.Int("index", index))
|
||||
|
||||
return
|
||||
return false
|
||||
}
|
||||
|
||||
// there is no signature collecting, so we don't need extra fee
|
||||
|
@ -34,13 +34,13 @@ func (ap *Processor) processEmit() {
|
|||
if err != nil {
|
||||
ap.log.Warn(logs.AlphabetCantInvokeAlphabetEmitMethod, zap.String("error", err.Error()))
|
||||
|
||||
return
|
||||
return false
|
||||
}
|
||||
|
||||
if ap.storageEmission == 0 {
|
||||
ap.log.Info(logs.AlphabetStorageNodeEmissionIsOff)
|
||||
|
||||
return
|
||||
return true
|
||||
}
|
||||
|
||||
networkMap, err := ap.netmapClient.NetMap()
|
||||
|
@ -48,7 +48,7 @@ func (ap *Processor) processEmit() {
|
|||
ap.log.Warn(logs.AlphabetCantGetNetmapSnapshotToEmitGasToStorageNodes,
|
||||
zap.String("error", err.Error()))
|
||||
|
||||
return
|
||||
return false
|
||||
}
|
||||
|
||||
nmNodes := networkMap.Nodes()
|
||||
|
@ -63,7 +63,7 @@ func (ap *Processor) processEmit() {
|
|||
zap.Int("extra_wallets", extraLen))
|
||||
|
||||
if nmLen+extraLen == 0 {
|
||||
return
|
||||
return true
|
||||
}
|
||||
|
||||
gasPerNode := fixedn.Fixed8(ap.storageEmission / uint64(nmLen+extraLen))
|
||||
|
@ -71,6 +71,8 @@ func (ap *Processor) processEmit() {
|
|||
ap.transferGasToNetmapNodes(nmNodes, gasPerNode)
|
||||
|
||||
ap.transferGasToExtraNodes(pw, gasPerNode)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func (ap *Processor) transferGasToNetmapNodes(nmNodes []netmap.NodeInfo, gasPerNode fixedn.Fixed8) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue