added GetQueueIds and expire at GetValues

This commit is contained in:
Radu Ioan Fericean
2014-08-01 17:49:18 +03:00
parent 1574de1d38
commit a096d97d94
3 changed files with 38 additions and 14 deletions

View File

@@ -30,7 +30,7 @@ type StatsQueue struct {
cdrs []*QCdr
conf *CdrStats
metrics map[string]Metric
mux sync.RWMutex
mux sync.Mutex
}
// Simplified cdr structure containing only the necessary info
@@ -141,8 +141,9 @@ func (sq *StatsQueue) purgeObsoleteCdrs() {
}
func (sq *StatsQueue) GetStats() map[string]float64 {
sq.mux.RLock()
defer sq.mux.RUnlock()
sq.mux.Lock()
defer sq.mux.Unlock()
sq.purgeObsoleteCdrs()
return sq.getStats()
}