mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Added RunningSince to cgr-console status
This commit is contained in:
committed by
Dan Christian Bogos
parent
db7826a5d7
commit
f4d6f4fca8
@@ -219,6 +219,7 @@ func (rs *Responder) Status(arg string, reply *map[string]interface{}) (err erro
|
||||
response[utils.ActiveGoroutines] = runtime.NumGoroutine()
|
||||
response["Footprint"] = utils.SizeFmt(float64(memstats.Sys), "")
|
||||
response[utils.Version] = utils.GetCGRVersion()
|
||||
response["RunningSince"] = utils.GetStartTime()
|
||||
*reply = response
|
||||
return
|
||||
}
|
||||
|
||||
@@ -46,6 +46,20 @@ import (
|
||||
"github.com/cgrates/rpcclient"
|
||||
)
|
||||
|
||||
var startCGRateSTime time.Time
|
||||
|
||||
func init() {
|
||||
startCGRateSTime = time.Now()
|
||||
}
|
||||
|
||||
func GetTimeElapsedFromStart() string {
|
||||
return time.Now().Sub(startCGRateSTime).Round(time.Second).String()
|
||||
}
|
||||
|
||||
func GetStartTime() string {
|
||||
return startCGRateSTime.Format(time.UnixDate)
|
||||
}
|
||||
|
||||
func NewCounter(start, limit int64) *Counter {
|
||||
return &Counter{
|
||||
value: start,
|
||||
|
||||
Reference in New Issue
Block a user