added cdrstats to test.sh and started getstats

This commit is contained in:
Radu Ioan Fericean
2014-07-01 23:33:08 +03:00
parent 38877ca8f9
commit 03dd27b8d8
2 changed files with 12 additions and 1 deletions

View File

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

View File

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