From 10308101df5c238dc20ba179fe06e7e15d1783c3 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 12 May 2021 11:46:29 +0300 Subject: [PATCH] [#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 --- cmd/neofs-node/config.go | 4 ---- cmd/neofs-node/object.go | 8 ++------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index b2317f830a..950569f5ce 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -92,8 +92,6 @@ const ( // config keys for cfgReputation cfgReputationContract = "reputation.scripthash" - cfgPolicerWorkScope = "policer.work_scope" - cfgPolicerExpRate = "policer.expansion_rate" cfgPolicerHeadTimeout = "policer.head_timeout" cfgReplicatorPutTimeout = "replicator.put_timeout" @@ -462,8 +460,6 @@ func defaultConfiguration(v *viper.Viper) { v.SetDefault(cfgMetricsShutdownTimeout, "30s") - v.SetDefault(cfgPolicerWorkScope, 100) - v.SetDefault(cfgPolicerExpRate, 10) // in % v.SetDefault(cfgPolicerHeadTimeout, 5*time.Second) v.SetDefault(cfgReplicatorPutTimeout, 5*time.Second) diff --git a/cmd/neofs-node/object.go b/cmd/neofs-node/object.go index 468ad61e15..f4de4e16d7 100644 --- a/cmd/neofs-node/object.go +++ b/cmd/neofs-node/object.go @@ -194,12 +194,8 @@ func initObjectService(c *cfg) { policer.WithPlacementBuilder( placement.NewNetworkMapSourceBuilder(c.cfgObject.netMapStorage), ), - policer.WithWorkScope( - c.viper.GetInt(cfgPolicerWorkScope), - ), - policer.WithExpansionRate( - c.viper.GetInt(cfgPolicerExpRate), - ), + policer.WithWorkScope(100), + policer.WithExpansionRate(10), policer.WithTrigger(ch), policer.WithRemoteHeader( headsvc.NewRemoteHeader(keyStorage, clientConstructor),