mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
cache_stats command
This commit is contained in:
committed by
Dan Christian Bogos
parent
8f8b821f17
commit
a4694509bf
@@ -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
|
||||
}
|
||||
|
||||
@@ -638,6 +638,10 @@ const (
|
||||
SMGenericV2UpdateSession = "SMGenericV2.UpdateSession"
|
||||
)
|
||||
|
||||
const (
|
||||
CacheSv1GetCacheStats = "CacheSv1.GetCacheStats"
|
||||
)
|
||||
|
||||
//CSV file name
|
||||
const (
|
||||
TIMINGS_CSV = "Timings.csv"
|
||||
|
||||
Reference in New Issue
Block a user