Skip to content

Commit

Permalink
Add Collection create time in show collection result (#159)
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Jun 26, 2023
1 parent 212e0d3 commit d5bcfd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions bapps/go_prompt_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ func HandleFD(p *prompt.Prompt) error {
}

func GetUnexportedField(field reflect.Value) interface{} {
// nolint
return reflect.NewAt(field.Type(), unsafe.Pointer(field.UnsafeAddr())).Elem().Interface()
}
4 changes: 3 additions & 1 deletion states/etcd/show/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/milvus-io/birdwatcher/models"
"github.com/milvus-io/birdwatcher/states/etcd/common"
etcdversion "github.com/milvus-io/birdwatcher/states/etcd/version"
"github.com/milvus-io/birdwatcher/utils"
)

// CollectionCommand returns sub command for showCmd.
Expand Down Expand Up @@ -81,7 +82,8 @@ func CollectionCommand(cli clientv3.KV, basePath string) *cobra.Command {
func printCollection(collection *models.Collection) {
fmt.Println("================================================================================")
fmt.Printf("Collection ID: %d\tCollection Name: %s\n", collection.ID, collection.Schema.Name)
fmt.Printf("Collection State: %s\n", collection.State.String())
t, _ := utils.ParseTS(collection.CreateTime)
fmt.Printf("Collection State: %s\tCreate Time: %s\n", collection.State.String(), t.Format("2006-01-02 15:04:05"))
/*
fmt.Printf("Partitions:\n")
for idx, partID := range collection.GetPartitionIDs() {
Expand Down

0 comments on commit d5bcfd9

Please sign in to comment.