mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 21:59:53 +05:00
Change prefix for StatsConfig
This commit is contained in:
@@ -189,7 +189,7 @@ func TestApierTPTimingAsExportSlice(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
/* De completat functia de test pentru ModelStats
|
||||
/*
|
||||
func TestAPItoModelStats(t *testing.T) {
|
||||
tpS := &utils.TPStats{
|
||||
TPid: "TPS1",
|
||||
|
||||
@@ -1475,7 +1475,7 @@ func (ms *MapStorage) RemoveVersions(vrs Versions) (err error) {
|
||||
}
|
||||
|
||||
// GetStatsQueue retrieves a StatsQueue from dataDB
|
||||
func (ms *MapStorage) GetStatsConfig(sqID string) (sq *StatsConfig, err error) {
|
||||
func (ms *MapStorage) GetStatsConfig(sqID string) (scf *StatsConfig, err error) {
|
||||
ms.mu.RLock()
|
||||
defer ms.mu.RUnlock()
|
||||
key := utils.StatsConfigPrefix + sqID
|
||||
@@ -1483,11 +1483,11 @@ func (ms *MapStorage) GetStatsConfig(sqID string) (sq *StatsConfig, err error) {
|
||||
if !ok {
|
||||
return nil, utils.ErrNotFound
|
||||
}
|
||||
err = ms.ms.Unmarshal(values, &sq)
|
||||
err = ms.ms.Unmarshal(values, &scf)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, fltr := range sq.Filters {
|
||||
for _, fltr := range scf.Filters {
|
||||
if err := fltr.CompileValues(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1496,22 +1496,22 @@ func (ms *MapStorage) GetStatsConfig(sqID string) (sq *StatsConfig, err error) {
|
||||
}
|
||||
|
||||
// SetStatsQueue stores a StatsQueue into DataDB
|
||||
func (ms *MapStorage) SetStatsConfig(sq *StatsConfig) (err error) {
|
||||
func (ms *MapStorage) SetStatsConfig(scf *StatsConfig) (err error) {
|
||||
ms.mu.Lock()
|
||||
defer ms.mu.Unlock()
|
||||
result, err := ms.ms.Marshal(sq)
|
||||
result, err := ms.ms.Marshal(scf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ms.dict[utils.StatsConfigPrefix+sq.ID] = result
|
||||
ms.dict[utils.StatsConfigPrefix+scf.ID] = result
|
||||
return
|
||||
}
|
||||
|
||||
// RemStatsQueue removes a StatsQueue from dataDB
|
||||
func (ms *MapStorage) RemStatsConfig(sqID string) (err error) {
|
||||
func (ms *MapStorage) RemStatsConfig(scfID string) (err error) {
|
||||
ms.mu.Lock()
|
||||
defer ms.mu.Unlock()
|
||||
key := utils.StatsConfigPrefix + sqID
|
||||
key := utils.StatsConfigPrefix + scfID
|
||||
delete(ms.dict, key)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ const (
|
||||
LOG_CDR = "cdr_"
|
||||
LOG_MEDIATED_CDR = "mcd_"
|
||||
SQStoredMetricsPrefix = "ssm_"
|
||||
StatsConfigPrefix = "stq_"
|
||||
StatsConfigPrefix = "scf_"
|
||||
ThresholdCfgPrefix = "thc_"
|
||||
LOADINST_KEY = "load_history"
|
||||
SESSION_MANAGER_SOURCE = "SMR"
|
||||
|
||||
Reference in New Issue
Block a user