From 4d5572d7ed99a6471c65f43358f5af38aa7ac619 Mon Sep 17 00:00:00 2001 From: jaime Date: Tue, 17 Dec 2024 22:30:44 +0800 Subject: [PATCH] enhance: [skip e2e] refine display format (#38537) issue: #36621 Signed-off-by: jaime --- internal/proxy/http_req_impl.go | 3 +-- pkg/util/metricsinfo/metrics_info.go | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/internal/proxy/http_req_impl.go b/internal/proxy/http_req_impl.go index 375aefe001011..5697e06d47122 100644 --- a/internal/proxy/http_req_impl.go +++ b/internal/proxy/http_req_impl.go @@ -37,7 +37,6 @@ import ( "github.com/milvus-io/milvus/pkg/util/merr" "github.com/milvus-io/milvus/pkg/util/metricsinfo" "github.com/milvus-io/milvus/pkg/util/paramtable" - "github.com/milvus-io/milvus/pkg/util/tsoutil" "github.com/milvus-io/milvus/pkg/util/typeutil" ) @@ -340,7 +339,7 @@ func describeCollection(node *Proxy) gin.HandlerFunc { collection := &metricsinfo.Collection{ CollectionID: strconv.FormatInt(describeCollectionResp.CollectionID, 10), CollectionName: describeCollectionResp.CollectionName, - CreatedTime: tsoutil.PhysicalTimeFormat(describeCollectionResp.CreatedUtcTimestamp), + CreatedTime: typeutil.TimestampToString(describeCollectionResp.CreatedUtcTimestamp), ShardsNum: int(describeCollectionResp.ShardsNum), ConsistencyLevel: describeCollectionResp.ConsistencyLevel.String(), Aliases: describeCollectionResp.Aliases, diff --git a/pkg/util/metricsinfo/metrics_info.go b/pkg/util/metricsinfo/metrics_info.go index be6b468b2bb9c..2f3e1b06eb345 100644 --- a/pkg/util/metricsinfo/metrics_info.go +++ b/pkg/util/metricsinfo/metrics_info.go @@ -440,7 +440,7 @@ type Field struct { } type Collection struct { - CollectionID string `json:"collection_id,omitempty,string"` + CollectionID string `json:"collection_id,omitempty"` CollectionName string `json:"collection_name,omitempty"` CreatedTime string `json:"created_time,omitempty"` ShardsNum int `json:"shards_num,omitempty"` @@ -470,15 +470,13 @@ type Databases struct { } type Index struct { - CollectionID int64 `json:"collection_id,omitempty,string"` - FieldID int64 `json:"field_id,omitempty,string"` - IndexID int64 `json:"index_id,omitempty,string"` - Name string `json:"name,omitempty"` - IsDeleted bool `json:"is_deleted"` - CreateTime string `json:"create_time,omitempty"` - IndexParams map[string]string `json:"index_params,omitempty"` - IsAutoIndex bool `json:"is_auto_index,omitempty"` - UserIndexParams map[string]string `json:"user_index_params"` - State string `json:"state,omitempty"` - IndexStateFailReason string `json:"index_state_fail_reason,omitempty"` + CollectionID int64 `json:"collection_id,omitempty,string"` + FieldID int64 `json:"field_id,omitempty,string"` + IndexID int64 `json:"index_id,omitempty,string"` + Name string `json:"name,omitempty"` + IsDeleted bool `json:"is_deleted"` + CreateTime string `json:"create_time,omitempty"` + IndexParams map[string]string `json:"index_params,omitempty"` + IsAutoIndex bool `json:"is_auto_index,omitempty"` + UserIndexParams map[string]string `json:"user_index_params"` }