cache_stats command

This commit is contained in:
Anevo
2018-03-12 11:22:31 -04:00
committed by Dan Christian Bogos
parent 8f8b821f17
commit a4694509bf
2 changed files with 14 additions and 5 deletions

View File

@@ -18,12 +18,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package console
import "github.com/cgrates/cgrates/utils"
import (
"github.com/cgrates/cgrates/utils"
"github.com/cgrates/ltcache"
)
func init() {
c := &CmdGetCacheStats{
name: "cache_stats",
rpcMethod: "ApierV1.GetCacheStats",
rpcMethod: utils.CacheSv1GetCacheStats,
rpcParams: []string{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -33,7 +37,7 @@ func init() {
type CmdGetCacheStats struct {
name string
rpcMethod string
rpcParams *utils.AttrCacheStats
rpcParams []string
*CommandExecuter
}
@@ -47,7 +51,7 @@ func (self *CmdGetCacheStats) RpcMethod() string {
func (self *CmdGetCacheStats) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.AttrCacheStats{}
self.rpcParams = []string{}
}
return self.rpcParams
}
@@ -57,5 +61,6 @@ func (self *CmdGetCacheStats) PostprocessRpcParams() error {
}
func (self *CmdGetCacheStats) RpcResult() interface{} {
return &utils.CacheStats{}
reply := make(map[string]*ltcache.CacheStats)
return &reply
}

View File

@@ -638,6 +638,10 @@ const (
SMGenericV2UpdateSession = "SMGenericV2.UpdateSession"
)
const (
CacheSv1GetCacheStats = "CacheSv1.GetCacheStats"
)
//CSV file name
const (
TIMINGS_CSV = "Timings.csv"