mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 16:48:45 +05:00
status for rater
This commit is contained in:
@@ -80,7 +80,12 @@ func (r *Responder) ResetUserBudget(arg timespans.CallDescriptor, replay *float6
|
||||
func (r *Responder) Status(arg timespans.CallDescriptor, replay *string) (err error) {
|
||||
memstats := new(runtime.MemStats)
|
||||
runtime.ReadMemStats(memstats)
|
||||
*replay = fmt.Sprintf("memstats before GC: %dKb footprint: %dKb", memstats.HeapAlloc/1024, memstats.Sys/1024)
|
||||
*replay = "Connected raters:\n"
|
||||
for _, rater := range raterList.clientAddresses {
|
||||
log.Print(rater)
|
||||
*replay += fmt.Sprintf("%v\n", rater)
|
||||
}
|
||||
*replay += fmt.Sprintf("memstats before GC: %dKb footprint: %dKb", memstats.HeapAlloc/1024, memstats.Sys/1024)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,17 @@ func main() {
|
||||
}
|
||||
|
||||
default:
|
||||
fmt.Print("hello!")
|
||||
fmt.Println("List of commands:")
|
||||
fmt.Println("\tgetcost")
|
||||
fmt.Println("\tgetmaxsessiontime")
|
||||
fmt.Println("\tdebitbalance")
|
||||
fmt.Println("\tdebitsms")
|
||||
fmt.Println("\tdebitseconds")
|
||||
fmt.Println("\taddvolumediscountseconds")
|
||||
fmt.Println("\tresetvolumediscountseconds")
|
||||
fmt.Println("\taddrecievedcallseconds")
|
||||
fmt.Println("\tresetuserbudget")
|
||||
fmt.Println("\tstatus")
|
||||
}
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
|
||||
@@ -19,12 +19,14 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/rif/cgrates/timespans"
|
||||
"log"
|
||||
"net"
|
||||
"net/rpc"
|
||||
"net/rpc/jsonrpc"
|
||||
"os"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -117,6 +119,13 @@ func (s *Responder) ResetUserBudget(cd timespans.CallDescriptor, reply *float64)
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *Responder) Status(arg timespans.CallDescriptor, replay *string) (err error) {
|
||||
memstats := new(runtime.MemStats)
|
||||
runtime.ReadMemStats(memstats)
|
||||
*replay = fmt.Sprintf("memstats before GC: %dKb footprint: %dKb", memstats.HeapAlloc/1024, memstats.Sys/1024)
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
RPC method that triggers rater shutdown in case of balancer exit.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user