mirror of https://github.com/milvus-io/milvus.git
Expose created time and updated time to rootcoord metrics (#8174)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>pull/7738/head
parent
daf001f683
commit
c3eb6f9761
|
@ -43,8 +43,9 @@ func (c *Core) getSystemInfoMetrics(ctx context.Context, req *milvuspb.GetMetric
|
|||
SystemVersion: os.Getenv(metricsinfo.GitCommitEnvKey),
|
||||
DeployMode: os.Getenv(metricsinfo.DeployModeEnvKey),
|
||||
},
|
||||
// TODO(dragondriver): CreatedTime & UpdatedTime, easy but time-costing
|
||||
Type: typeutil.RootCoordRole,
|
||||
CreatedTime: Params.CreatedTime.String(),
|
||||
UpdatedTime: Params.UpdatedTime.String(),
|
||||
Type: typeutil.RootCoordRole,
|
||||
},
|
||||
SystemConfigurations: metricsinfo.RootCoordConfiguration{
|
||||
MinSegmentSizeToEnableIndex: Params.MinSegmentSizeToEnableIndex,
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
"path"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/log"
|
||||
"github.com/milvus-io/milvus/internal/util/paramtable"
|
||||
|
@ -47,6 +48,9 @@ type ParamTable struct {
|
|||
Timeout int
|
||||
TimeTickInterval int
|
||||
|
||||
CreatedTime time.Time
|
||||
UpdatedTime time.Time
|
||||
|
||||
Log log.Config
|
||||
|
||||
RoleName string
|
||||
|
|
|
@ -13,6 +13,7 @@ package rootcoord
|
|||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
@ -58,4 +59,9 @@ func TestParamTable(t *testing.T) {
|
|||
|
||||
assert.NotZero(t, Params.TimeTickInterval)
|
||||
t.Logf("master timetickerInterval = %d", Params.TimeTickInterval)
|
||||
|
||||
Params.CreatedTime = time.Now()
|
||||
Params.UpdatedTime = time.Now()
|
||||
t.Logf("created time: %v", Params.CreatedTime)
|
||||
t.Logf("updated time: %v", Params.UpdatedTime)
|
||||
}
|
||||
|
|
|
@ -1111,9 +1111,15 @@ func (c *Core) Start() error {
|
|||
go c.sessionLoop()
|
||||
go c.chanTimeTick.StartWatch(&c.wg)
|
||||
go c.checkFlushedSegmentsLoop()
|
||||
|
||||
Params.CreatedTime = time.Now()
|
||||
Params.UpdatedTime = time.Now()
|
||||
|
||||
c.stateCode.Store(internalpb.StateCode_Healthy)
|
||||
})
|
||||
|
||||
log.Debug(typeutil.RootCoordRole, zap.String("State Code", internalpb.StateCode_name[int32(internalpb.StateCode_Healthy)]))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue