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

@@ -46,8 +46,7 @@ import (
)
var (
startCGRateSTime time.Time
boolGenerator *boolGen
boolGenerator *boolGen
rfc3339Rule = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.+$`)
sqlRule = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$`)
@@ -66,15 +65,9 @@ var (
)
func init() {
startCGRateSTime = time.Now()
boolGenerator = newBoolGen()
}
// GetStartTime return the Start time of engine (in UNIX format)
func GetStartTime() string {
return startCGRateSTime.Format(time.UnixDate)
}
// BoolGenerator return the boolean generator
func BoolGenerator() *boolGen {
return boolGenerator