From 5ffbf094d85d4de278f517d85f74f96377fc3919 Mon Sep 17 00:00:00 2001 From: Tripon Alexandru-Ionut Date: Thu, 11 Apr 2019 16:31:57 +0300 Subject: [PATCH] Renamed max_queue_length to Store_uncompressed_limit --- config/config_defaults.go | 2 +- config/config_json_test.go | 14 +++++++------- config/libconfig_json.go | 14 +++++++------- config/statscfg.go | 18 +++++++++--------- data/conf/cgrates/cgrates.json | 2 +- engine/libstats.go | 2 +- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/config/config_defaults.go b/config/config_defaults.go index 93c50f2fb..ccb75a2a9 100755 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -497,7 +497,7 @@ const CGRATES_CFG_JSON = ` "stats": { // StatS config "enabled": false, // starts Stat service: . "store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur> - "max_queue_length": 0, // used to compress data + "store_uncompressed_limit": 0, // used to compress data "thresholds_conns": [], // connections to ThresholdS for StatUpdates, empty to disable thresholds functionality: <""|*internal|x.y.z.y:1234> "indexed_selects":true, // enable profile matching exclusively on indexes //"string_indexed_fields": [], // query indexes based on these fields for faster processing diff --git a/config/config_json_test.go b/config/config_json_test.go index bacbdf7ce..04df53730 100755 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -817,13 +817,13 @@ func TestDfResourceLimiterSJsonCfg(t *testing.T) { func TestDfStatServiceJsonCfg(t *testing.T) { eCfg := &StatServJsonCfg{ - Enabled: utils.BoolPointer(false), - Indexed_selects: utils.BoolPointer(true), - Store_interval: utils.StringPointer(""), - Max_queue_length: utils.IntPointer(0), - Thresholds_conns: &[]*RemoteHostJson{}, - String_indexed_fields: nil, - Prefix_indexed_fields: &[]string{}, + Enabled: utils.BoolPointer(false), + Indexed_selects: utils.BoolPointer(true), + Store_interval: utils.StringPointer(""), + Store_uncompressed_limit: utils.IntPointer(0), + Thresholds_conns: &[]*RemoteHostJson{}, + String_indexed_fields: nil, + Prefix_indexed_fields: &[]string{}, } if cfg, err := dfCgrJsonCfg.StatSJsonCfg(); err != nil { t.Error(err) diff --git a/config/libconfig_json.go b/config/libconfig_json.go index 5409c3273..b5b06a9e8 100755 --- a/config/libconfig_json.go +++ b/config/libconfig_json.go @@ -447,13 +447,13 @@ type ResourceSJsonCfg struct { // Stat service config section type StatServJsonCfg struct { - Enabled *bool - Indexed_selects *bool - Store_interval *string - Max_queue_length *int - Thresholds_conns *[]*RemoteHostJson - String_indexed_fields *[]string - Prefix_indexed_fields *[]string + Enabled *bool + Indexed_selects *bool + Store_interval *string + Store_uncompressed_limit *int + Thresholds_conns *[]*RemoteHostJson + String_indexed_fields *[]string + Prefix_indexed_fields *[]string } // Threshold service config section diff --git a/config/statscfg.go b/config/statscfg.go index 0a752937f..2ca5c7b13 100644 --- a/config/statscfg.go +++ b/config/statscfg.go @@ -25,13 +25,13 @@ import ( ) type StatSCfg struct { - Enabled bool - IndexedSelects bool - StoreInterval time.Duration // Dump regularly from cache into dataDB - MaxQueueLenght int - ThresholdSConns []*RemoteHost - StringIndexedFields *[]string - PrefixIndexedFields *[]string + Enabled bool + IndexedSelects bool + StoreInterval time.Duration // Dump regularly from cache into dataDB + StoreUncompressedLimit int + ThresholdSConns []*RemoteHost + StringIndexedFields *[]string + PrefixIndexedFields *[]string } func (st *StatSCfg) loadFromJsonCfg(jsnCfg *StatServJsonCfg) (err error) { @@ -49,8 +49,8 @@ func (st *StatSCfg) loadFromJsonCfg(jsnCfg *StatServJsonCfg) (err error) { return err } } - if jsnCfg.Max_queue_length != nil { - st.MaxQueueLenght = *jsnCfg.Max_queue_length + if jsnCfg.Store_uncompressed_limit != nil { + st.StoreUncompressedLimit = *jsnCfg.Store_uncompressed_limit } if jsnCfg.Thresholds_conns != nil { st.ThresholdSConns = make([]*RemoteHost, len(*jsnCfg.Thresholds_conns)) diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index c99936af1..40c57cf7d 100644 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -458,7 +458,7 @@ // "stats": { // StatS config // "enabled": false, // starts Stat service: . // "store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur> -// "max_queue_length": 0, // used to compress data +// "store_uncompressed_limit": 0, // used to compress data // "thresholds_conns": [], // connections to ThresholdS for StatUpdates, empty to disable thresholds functionality: <""|*internal|x.y.z.y:1234> // "indexed_selects":true, // enable profile matching exclusively on indexes // //"string_indexed_fields": [], // query indexes based on these fields for faster processing diff --git a/engine/libstats.go b/engine/libstats.go index 6e24a5f61..ee9e3e338 100644 --- a/engine/libstats.go +++ b/engine/libstats.go @@ -58,7 +58,7 @@ func NewStoredStatQueue(sq *StatQueue, ms Marshaler) (sSQ *StoredStatQueue, err sSQ = &StoredStatQueue{ Tenant: sq.Tenant, ID: sq.ID, - Compressed: sq.Compress(int64(config.CgrConfig().StatSCfg().MaxQueueLenght)), + Compressed: sq.Compress(int64(config.CgrConfig().StatSCfg().StoreUncompressedLimit)), SQItems: make([]SQItem, len(sq.SQItems)), SQMetrics: make(map[string][]byte, len(sq.SQMetrics)), MinItems: sq.MinItems,