improve CoreSv1.Status API with more detailed metrics

- add new metrics (off by default)
- add Debug boolean option for full metric details
- add Timezone option for 'running_since' field
- update default metrics shown and their constants
- remove utils.GetStartTime(), now use process metrics
This commit is contained in:
ionutboangiu
2024-09-06 23:11:06 +03:00
committed by Dan Christian Bogos
parent 98f770c61b
commit 62c30ab539
13 changed files with 416 additions and 124 deletions

View File

@@ -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/cores"
"github.com/cgrates/cgrates/utils"
)
func init() {
c := &CmdStatus{
name: "status",
rpcMethod: utils.CoreSv1Status,
rpcParams: &cores.V1StatusParams{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -32,7 +36,7 @@ func init() {
type CmdStatus struct {
name string
rpcMethod string
rpcParams *utils.TenantWithAPIOpts
rpcParams *cores.V1StatusParams
*CommandExecuter
}
@@ -46,7 +50,7 @@ func (self *CmdStatus) RpcMethod() string {
func (self *CmdStatus) RpcParams(reset bool) any {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.TenantWithAPIOpts{
self.rpcParams = &cores.V1StatusParams{
APIOpts: make(map[string]any),
}
}
@@ -61,7 +65,3 @@ func (self *CmdStatus) RpcResult() any {
var s map[string]any
return &s
}
func (self *CmdStatus) ClientArgs() (args []string) {
return
}