[#493] node: Abolish some of the Policer's configurations

Make work scope and expansion rate the app-side constants since Policer
independently regulates the amount of work performed.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-12 11:46:29 +03:00 committed by Leonard Lyubich
parent 80ef4492c1
commit 10308101df
2 changed files with 2 additions and 10 deletions

View file

@ -92,8 +92,6 @@ const (
// config keys for cfgReputation // config keys for cfgReputation
cfgReputationContract = "reputation.scripthash" cfgReputationContract = "reputation.scripthash"
cfgPolicerWorkScope = "policer.work_scope"
cfgPolicerExpRate = "policer.expansion_rate"
cfgPolicerHeadTimeout = "policer.head_timeout" cfgPolicerHeadTimeout = "policer.head_timeout"
cfgReplicatorPutTimeout = "replicator.put_timeout" cfgReplicatorPutTimeout = "replicator.put_timeout"
@ -462,8 +460,6 @@ func defaultConfiguration(v *viper.Viper) {
v.SetDefault(cfgMetricsShutdownTimeout, "30s") v.SetDefault(cfgMetricsShutdownTimeout, "30s")
v.SetDefault(cfgPolicerWorkScope, 100)
v.SetDefault(cfgPolicerExpRate, 10) // in %
v.SetDefault(cfgPolicerHeadTimeout, 5*time.Second) v.SetDefault(cfgPolicerHeadTimeout, 5*time.Second)
v.SetDefault(cfgReplicatorPutTimeout, 5*time.Second) v.SetDefault(cfgReplicatorPutTimeout, 5*time.Second)

View file

@ -194,12 +194,8 @@ func initObjectService(c *cfg) {
policer.WithPlacementBuilder( policer.WithPlacementBuilder(
placement.NewNetworkMapSourceBuilder(c.cfgObject.netMapStorage), placement.NewNetworkMapSourceBuilder(c.cfgObject.netMapStorage),
), ),
policer.WithWorkScope( policer.WithWorkScope(100),
c.viper.GetInt(cfgPolicerWorkScope), policer.WithExpansionRate(10),
),
policer.WithExpansionRate(
c.viper.GetInt(cfgPolicerExpRate),
),
policer.WithTrigger(ch), policer.WithTrigger(ch),
policer.WithRemoteHeader( policer.WithRemoteHeader(
headsvc.NewRemoteHeader(keyStorage, clientConstructor), headsvc.NewRemoteHeader(keyStorage, clientConstructor),