diff --git a/console/cache_stats.go b/console/cache_stats.go index b398e04b6..737609a7b 100644 --- a/console/cache_stats.go +++ b/console/cache_stats.go @@ -18,12 +18,16 @@ along with this program. If not, see 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 } diff --git a/utils/consts.go b/utils/consts.go index d108c7ad0..1d557aa8c 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -638,6 +638,10 @@ const ( SMGenericV2UpdateSession = "SMGenericV2.UpdateSession" ) +const ( + CacheSv1GetCacheStats = "CacheSv1.GetCacheStats" +) + //CSV file name const ( TIMINGS_CSV = "Timings.csv"