Esempio n. 1
0
func (rs *Responder) Status(arg string, reply *map[string]interface{}) (err error) {
	memstats := new(runtime.MemStats)
	runtime.ReadMemStats(memstats)
	response := make(map[string]interface{})
	response[utils.InstanceID] = config.CgrConfig().InstanceID
	if rs.Bal != nil {
		response["Raters"] = rs.Bal.GetClientAddresses()
	}
	response["memstat"] = utils.SizeFmt(float64(memstats.HeapAlloc), "")
	response["footprint"] = utils.SizeFmt(float64(memstats.Sys), "")
	*reply = response
	return
}
Esempio n. 2
0
func (rs *Responder) Status(arg string, reply *map[string]interface{}) (err error) {
	if arg != "" { // Introduce  delay in answer, used in some automated tests
		if delay, err := utils.ParseDurationWithSecs(arg); err == nil {
			time.Sleep(delay)
		}
	}
	memstats := new(runtime.MemStats)
	runtime.ReadMemStats(memstats)
	response := make(map[string]interface{})
	response[utils.InstanceID] = config.CgrConfig().InstanceID
	if rs.Bal != nil {
		response["Raters"] = rs.Bal.GetClientAddresses()
	}
	response["memstat"] = utils.SizeFmt(float64(memstats.HeapAlloc), "")
	response["footprint"] = utils.SizeFmt(float64(memstats.Sys), "")
	*reply = response
	return
}