Skip to content

Commit

Permalink
Export indexed rows for descrieb_index
Browse files Browse the repository at this point in the history
Signed-off-by: Cai Zhang <[email protected]>
  • Loading branch information
xiaocai2333 committed Jun 25, 2024
1 parent 6404f1b commit d5750cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ func (c *GrpcClient) DescribeIndex(ctx context.Context, collName string, fieldNa
}
params := entity.KvPairsMap(info.Params)
it := params["index_type"] // TODO change to const
params["total_rows"] = strconv.FormatInt(info.GetTotalRows(), 10)
params["indexed_rows"] = strconv.FormatInt(info.GetIndexedRows(), 10)
params["pending_index_rows"] = strconv.FormatInt(info.GetPendingIndexRows(), 10)
params["state"] = info.GetState().String()
idx := entity.NewGenericIndex(
info.IndexName,
entity.IndexType(it),
Expand Down
4 changes: 4 additions & 0 deletions client/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ func TestGrpcClientDescribeIndex(t *testing.T) {
"nlist": "1024",
"metric_type": "IP",
}),
TotalRows: 10000,
IndexedRows: 4000,
PendingIndexRows: 10000,
State: commonpb.IndexState_InProgress,
},
}
s, err := SuccessStatus()
Expand Down

0 comments on commit d5750cc

Please sign in to comment.