mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Merge branch 'master' of https://github.com/cgrates/cgrates
This commit is contained in:
@@ -20,6 +20,7 @@ package apier
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
@@ -64,6 +64,9 @@ func (asr *ASRMetric) RemoveCdr(cdr *QCdr) {
|
||||
}
|
||||
|
||||
func (asr *ASRMetric) GetValue() float64 {
|
||||
if asr.total == 0 {
|
||||
return 0
|
||||
}
|
||||
return asr.answered / asr.total * 100
|
||||
}
|
||||
|
||||
@@ -89,6 +92,9 @@ func (acd *ACDMetric) RemoveCdr(cdr *QCdr) {
|
||||
}
|
||||
|
||||
func (acd *ACDMetric) GetValue() float64 {
|
||||
if acd.count == 0 {
|
||||
return 0
|
||||
}
|
||||
return acd.sum.Seconds() / acd.count
|
||||
}
|
||||
|
||||
@@ -114,5 +120,8 @@ func (acc *ACCMetric) RemoveCdr(cdr *QCdr) {
|
||||
}
|
||||
|
||||
func (acc *ACCMetric) GetValue() float64 {
|
||||
if acc.count == 0 {
|
||||
return 0
|
||||
}
|
||||
return acc.sum / acc.count
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user