Renamed max_queue_length to Store_uncompressed_limit

This commit is contained in:
Tripon Alexandru-Ionut
2019-04-11 16:31:57 +03:00
committed by Dan Christian Bogos
parent 0734d8b74d
commit 5ffbf094d8
6 changed files with 26 additions and 26 deletions

View File

@@ -497,7 +497,7 @@ const CGRATES_CFG_JSON = `
"stats": { // StatS config
"enabled": false, // starts Stat service: <true|false>.
"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

View File

@@ -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)

View File

@@ -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

View File

@@ -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))

View File

@@ -458,7 +458,7 @@
// "stats": { // StatS config
// "enabled": false, // starts Stat service: <true|false>.
// "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

View File

@@ -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,