mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
update cdr stats on engine start
This commit is contained in:
@@ -464,6 +464,11 @@ func main() {
|
||||
|
||||
if cfg.CDRStatsEnabled {
|
||||
cdrStats = &engine.Stats{}
|
||||
if css, err := accountDb.GetAllCdrStats(); err == nil {
|
||||
cdrStats.UpdateQueues(css, nil)
|
||||
} else {
|
||||
engine.Logger.Err(fmt.Sprintf("Cannot load cdr stats: %v", err))
|
||||
}
|
||||
server.RpcRegister(cdrStats)
|
||||
}
|
||||
|
||||
|
||||
@@ -101,13 +101,17 @@ func NewProxyStats(addr string) (*ProxyStats, error) {
|
||||
}
|
||||
|
||||
func (ps *ProxyStats) AddQueue(sq *StatsQueue, out *int) error {
|
||||
return ps.Client.Call("Scribe.AddQueue", sq, out)
|
||||
return ps.Client.Call("Stats.AddQueue", sq, out)
|
||||
}
|
||||
|
||||
func (ps *ProxyStats) GetValues(sqID string, values *map[string]float64) error {
|
||||
return ps.Client.Call("Scribe.GetValues", sqID, values)
|
||||
return ps.Client.Call("Stats.GetValues", sqID, values)
|
||||
}
|
||||
|
||||
func (ps *ProxyStats) AppendCDR(cdr *utils.StoredCdr, out *int) error {
|
||||
return ps.Client.Call("Scribe.AppendCDR", cdr, out)
|
||||
return ps.Client.Call("Stats.AppendCDR", cdr, out)
|
||||
}
|
||||
|
||||
/*func (ps *ProxyStats) UpdateQueues(css []*CdrStats, out *int) error {
|
||||
return ps.Client.Call("Stats.UpdateQueues", css, out)
|
||||
}*/
|
||||
|
||||
Reference in New Issue
Block a user