mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
added cdrstats to test.sh and started getstats
This commit is contained in:
@@ -104,6 +104,14 @@ func (sq *StatsQueue) PurgeObsoleteCDRs() {
|
||||
}
|
||||
}
|
||||
|
||||
func (sq *StatsQueue) GetStats() map[string]float64 {
|
||||
stat := make(map[string]float64, len(sq.metrics))
|
||||
for key, metric := range sq.metrics {
|
||||
stat[key] = metric.GetValue()
|
||||
}
|
||||
return stat
|
||||
}
|
||||
|
||||
func (sq *StatsQueue) AcceptCDR(cdr *utils.StoredCdr) bool {
|
||||
if len(sq.conf.SetupInterval) > 0 {
|
||||
if cdr.SetupTime.Before(sq.conf.SetupInterval[0]) {
|
||||
|
||||
5
test.sh
5
test.sh
@@ -12,6 +12,7 @@ go test -i github.com/cgrates/cgrates/cdrc
|
||||
go test -i github.com/cgrates/cgrates/utils
|
||||
go test -i github.com/cgrates/cgrates/history
|
||||
go test -i github.com/cgrates/cgrates/cdre
|
||||
go test -i github.com/cgrates/cgrates/cdrstats
|
||||
|
||||
go test github.com/cgrates/cgrates/engine
|
||||
en=$?
|
||||
@@ -39,6 +40,8 @@ go test github.com/cgrates/cgrates/cache2go
|
||||
c2g=$?
|
||||
go test github.com/cgrates/cgrates/cdre
|
||||
cdre=$?
|
||||
go test github.com/cgrates/cgrates/cdrstats
|
||||
stats=$?
|
||||
|
||||
|
||||
exit $en && $gt && $sm && $cfg && $bl && $cr && $md && $cdrs && $cdrc && $fs && $ut && $hs && $c2g && $cdre
|
||||
exit $en && $gt && $sm && $cfg && $bl && $cr && $md && $cdrs && $cdrc && $fs && $ut && $hs && $c2g && $cdre && $stats
|
||||
|
||||
Reference in New Issue
Block a user