mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 13:49:53 +05:00
Reverting to cdrstats instead of cdr_stats for subsystems naming consistency
This commit is contained in:
@@ -106,7 +106,7 @@ const CGRATES_CFG_JSON = `
|
||||
},
|
||||
|
||||
|
||||
"cdr_stats": {
|
||||
"cdrstats": {
|
||||
"enabled": false, // starts the cdrstats service: <true|false>
|
||||
"queue_length": 50, // number of items in the stats buffer
|
||||
"time_window": "1h", // will only keep the CDRs who's call setup time is not older than time.Now()-TimeWindow
|
||||
|
||||
@@ -36,7 +36,7 @@ const (
|
||||
SCHEDULER_JSN = "scheduler"
|
||||
CDRS_JSN = "cdrs"
|
||||
MEDIATOR_JSN = "mediator"
|
||||
CDRSTATS_JSN = "cdr_stats"
|
||||
CDRSTATS_JSN = "cdrstats"
|
||||
CDRE_JSN = "cdre"
|
||||
CDRC_JSN = "cdrc"
|
||||
SMFS_JSN = "sm_freeswitch"
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
//},
|
||||
|
||||
|
||||
//"cdr_stats": {
|
||||
//"cdrstats": {
|
||||
// "enabled": false, // starts the cdrstats service: <true|false>
|
||||
// "queue_length": 50, // number of items in the stats buffer
|
||||
// "time_window": "1h", // will only keep the CDRs who's call setup time is not older than time.Now()-TimeWindow
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
"cdrstats": "internal", // address where to reach the cdrstats service. Empty to disable stats gathering out of mediated CDRs <""|internal|x.y.z.y:1234>
|
||||
},
|
||||
|
||||
"cdr_stats": {
|
||||
"cdrstats": {
|
||||
"enabled": true, // starts the cdrstats service: <true|false>
|
||||
"queue_length": 5, // number of items in the stats buffer
|
||||
"time_window": "0", // will only keep the CDRs who's call setup time is not older than time.Now()-TimeWindow
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"cdrstats": "internal", // address where to reach the cdrstats service, empty to disable stats functionality<""|internal|x.y.z.y:1234>
|
||||
},
|
||||
|
||||
"cdr_stats": {
|
||||
"cdrstats": {
|
||||
"enabled": true, // starts the cdrstats service: <true|false>
|
||||
},
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"cdrstats": "internal", // address where to reach the cdrstats service, empty to disable stats functionality<""|internal|x.y.z.y:1234>
|
||||
},
|
||||
|
||||
"cdr_stats": {
|
||||
"cdrstats": {
|
||||
"enabled": true, // starts the cdrstats service: <true|false>
|
||||
},
|
||||
|
||||
|
||||
@@ -298,11 +298,11 @@ CREATE TABLE tp_derived_chargers (
|
||||
|
||||
|
||||
--
|
||||
-- Table structure for table `tp_cdr_stats`
|
||||
-- Table structure for table `tp_cdrstats`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS tp_cdr_stats;
|
||||
CREATE TABLE tp_cdr_stats (
|
||||
DROP TABLE IF EXISTS tp_cdrstats;
|
||||
CREATE TABLE tp_cdrstats (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`tpid` varchar(64) NOT NULL,
|
||||
`tag` varchar(64) NOT NULL,
|
||||
|
||||
@@ -293,11 +293,11 @@ CREATE INDEX tpderivedchargers_idx ON tp_derived_chargers (tpid,loadid,direction
|
||||
|
||||
|
||||
--
|
||||
-- Table structure for table `tp_cdr_stats`
|
||||
-- Table structure for table `tp_cdrstats`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS tp_cdr_stats;
|
||||
CREATE TABLE tp_cdr_stats (
|
||||
DROP TABLE IF EXISTS tp_cdrstats;
|
||||
CREATE TABLE tp_cdrstats (
|
||||
id SERIAL PRIMARY KEY,
|
||||
tpid VARCHAR(64) NOT NULL,
|
||||
tag VARCHAR(64) NOT NULL,
|
||||
@@ -325,5 +325,5 @@ CREATE TABLE tp_cdr_stats (
|
||||
action_triggers VARCHAR(64) NOT NULL,
|
||||
created_at TIMESTAMP
|
||||
);
|
||||
CREATE INDEX tpcdrstats_tpid_idx ON tp_cdr_stats (tpid);
|
||||
CREATE INDEX tpcdrstats_idx ON tp_cdr_stats (tpid,tag);
|
||||
CREATE INDEX tpcdrstats_tpid_idx ON tp_cdrstats (tpid);
|
||||
CREATE INDEX tpcdrstats_idx ON tp_cdrstats (tpid,tag);
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
// "cdr_replication":[], // replicate the raw CDR to a number of servers
|
||||
},
|
||||
|
||||
"cdr_stats": {
|
||||
"cdrstats": {
|
||||
"enabled": true, // starts the cdrstats service: <true|false>
|
||||
// "queue_length": 50, // number of items in the stats buffer
|
||||
// "time_window": "1h", // will only keep the CDRs who's call setup time is not older than time.Now()-TimeWindow
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
// "cdr_replication":[], // replicate the raw CDR to a number of servers
|
||||
},
|
||||
|
||||
"cdr_stats": {
|
||||
"cdrstats": {
|
||||
"enabled": true, // starts the cdrstats service: <true|false>
|
||||
// "queue_length": 50, // number of items in the stats buffer
|
||||
// "time_window": "1h", // will only keep the CDRs who's call setup time is not older than time.Now()-TimeWindow
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
},
|
||||
|
||||
|
||||
"cdr_stats": {
|
||||
"cdrstats": {
|
||||
"enabled": true, // starts the cdrstats service: <true|false>
|
||||
},
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ func (tpdc *TpDerivedCharger) SetDerivedChargersId(id string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type TpCdrStat struct {
|
||||
type TpCdrstat struct {
|
||||
Id int64
|
||||
Tpid string
|
||||
Tag string
|
||||
|
||||
@@ -383,13 +383,13 @@ func (self *SQLStorage) SetTPCdrStats(tpid string, css map[string][]*utils.TPCdr
|
||||
}
|
||||
tx := self.db.Begin()
|
||||
for csId, cStats := range css {
|
||||
if err := tx.Where(&TpCdrStat{Tpid: tpid, Tag: csId}).Delete(TpCdrStat{}).Error; err != nil {
|
||||
if err := tx.Where(&TpCdrstat{Tpid: tpid, Tag: csId}).Delete(TpCdrstat{}).Error; err != nil {
|
||||
tx.Rollback()
|
||||
return err
|
||||
}
|
||||
for _, cs := range cStats {
|
||||
ql, _ := strconv.Atoi(cs.QueueLength)
|
||||
saved := tx.Save(&TpCdrStat{
|
||||
saved := tx.Save(&TpCdrstat{
|
||||
Tpid: tpid,
|
||||
Tag: csId,
|
||||
QueueLength: ql,
|
||||
@@ -1430,7 +1430,7 @@ func (self *SQLStorage) GetTpSharedGroups(tpid, tag string) (map[string][]*utils
|
||||
func (self *SQLStorage) GetTpCdrStats(tpid, tag string) (map[string][]*utils.TPCdrStat, error) {
|
||||
css := make(map[string][]*utils.TPCdrStat)
|
||||
|
||||
var tpCdrStats []TpCdrStat
|
||||
var tpCdrStats []TpCdrstat
|
||||
q := self.db.Where("tpid = ?", tpid)
|
||||
if len(tag) != 0 {
|
||||
q = q.Where("tag = ?", tag)
|
||||
|
||||
@@ -35,7 +35,7 @@ const (
|
||||
TBL_TP_RATING_PLANS = "tp_rating_plans"
|
||||
TBL_TP_RATE_PROFILES = "tp_rating_profiles"
|
||||
TBL_TP_SHARED_GROUPS = "tp_shared_groups"
|
||||
TBL_TP_CDR_STATS = "tp_cdr_stats"
|
||||
TBL_TP_CDR_STATS = "tp_cdrstats"
|
||||
TBL_TP_LCRS = "tp_lcr_rules"
|
||||
TBL_TP_ACTIONS = "tp_actions"
|
||||
TBL_TP_ACTION_PLANS = "tp_action_plans"
|
||||
|
||||
Reference in New Issue
Block a user