Skip to content

Commit

Permalink
Implement ngt Statistics API
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <kpango@vdaas.org>
  • Loading branch information
kpango committed Jul 24, 2024
1 parent 76eb8d7 commit 2b3754d
Show file tree
Hide file tree
Showing 31 changed files with 3,560 additions and 606 deletions.
3 changes: 2 additions & 1 deletion Makefile.d/proto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ proto/gen: \
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%google.golang.org/grpc/status%github.com/vdaas/vald/internal/net/grpc/status%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%\"io\"%\"github.com/vdaas/vald/internal/io\"%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%\"sync\"%\"github.com/vdaas/vald/internal/sync\"%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%any%any%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%interface{}%any%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%For_%For%g"
74 changes: 70 additions & 4 deletions apis/docs/v1/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
- [Info.Index.Count](#payload-v1-Info-Index-Count)
- [Info.Index.Detail](#payload-v1-Info-Index-Detail)
- [Info.Index.Detail.CountsEntry](#payload-v1-Info-Index-Detail-CountsEntry)
- [Info.Index.Statistics](#payload-v1-Info-Index-Statistics)
- [Info.Index.StatisticsDetail](#payload-v1-Info-Index-StatisticsDetail)
- [Info.Index.StatisticsDetail.CountsEntry](#payload-v1-Info-Index-StatisticsDetail-CountsEntry)
- [Info.Index.UUID](#payload-v1-Info-Index-UUID)
- [Info.Index.UUID.Committed](#payload-v1-Info-Index-UUID-Committed)
- [Info.Index.UUID.Uncommitted](#payload-v1-Info-Index-UUID-Uncommitted)
Expand Down Expand Up @@ -317,6 +320,67 @@ Represent the index count for each Agents message.
| key | [string](#string) | | |
| value | [Info.Index.Count](#payload-v1-Info-Index-Count) | | |

<a name="payload-v1-Info-Index-Statistics"></a>

### Info.Index.Statistics

Represents index Statistics

| Field | Type | Label | Description |
| ------------------------------------ | ----------------- | -------- | ----------- |
| valid | [bool](#bool) | | |
| median_indegree | [int32](#int32) | | |
| median_outdegree | [int32](#int32) | | |
| max_number_of_indegree | [uint64](#uint64) | | |
| max_number_of_outdegree | [uint64](#uint64) | | |
| min_number_of_indegree | [uint64](#uint64) | | |
| min_number_of_outdegree | [uint64](#uint64) | | |
| mode_indegree | [uint64](#uint64) | | |
| mode_outdegree | [uint64](#uint64) | | |
| nodes_skipped_for_10_edges | [uint64](#uint64) | | |
| nodes_skipped_for_indegree_distance | [uint64](#uint64) | | |
| number_of_edges | [uint64](#uint64) | | |
| number_of_indexed_objects | [uint64](#uint64) | | |
| number_of_nodes | [uint64](#uint64) | | |
| number_of_nodes_without_edges | [uint64](#uint64) | | |
| number_of_nodes_without_indegree | [uint64](#uint64) | | |
| number_of_objects | [uint64](#uint64) | | |
| number_of_removed_objects | [uint64](#uint64) | | |
| size_of_object_repository | [uint64](#uint64) | | |
| size_of_refinement_object_repository | [uint64](#uint64) | | |
| variance_of_indegree | [double](#double) | | |
| variance_of_outdegree | [double](#double) | | |
| mean_edge_length | [double](#double) | | |
| mean_edge_length_for_10_edges | [double](#double) | | |
| mean_indegree_distance_for_10_edges | [double](#double) | | |
| mean_number_of_edges_per_node | [double](#double) | | |
| c1_indegree | [double](#double) | | |
| c5_indegree | [double](#double) | | |
| c95_outdegree | [double](#double) | | |
| c99_outdegree | [double](#double) | | |
| indegree_count | [int64](#int64) | repeated | |
| outdegree_histogram | [uint64](#uint64) | repeated | |
| indegree_histogram | [uint64](#uint64) | repeated | |

<a name="payload-v1-Info-Index-StatisticsDetail"></a>

### Info.Index.StatisticsDetail

Represents index Statistics for each Agents

| Field | Type | Label | Description |
| ------ | ---------------------------------------------------------------------------------------------- | -------- | --------------------------- |
| counts | [Info.Index.StatisticsDetail.CountsEntry](#payload-v1-Info-Index-StatisticsDetail-CountsEntry) | repeated | count infos for each agents |

<a name="payload-v1-Info-Index-StatisticsDetail-CountsEntry"></a>

### Info.Index.StatisticsDetail.CountsEntry

| Field | Type | Label | Description |
| ----- | ---------------------------------------------------------- | ----- | ----------- |
| key | [string](#string) | | |
| value | [Info.Index.Statistics](#payload-v1-Info-Index-Statistics) | | |

<a name="payload-v1-Info-Index-UUID"></a>

### Info.Index.UUID
Expand Down Expand Up @@ -1497,10 +1561,12 @@ Flush service provides ways to flush all indexed vectors.

Represent the index manager service.

| Method Name | Request Type | Response Type | Description |
| ----------- | -------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------- |
| IndexInfo | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Count](#payload-v1-Info-Index-Count) | Represent the RPC to get the index information. |
| IndexDetail | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Detail](#payload-v1-Info-Index-Detail) | Represent the RPC to get the index information for each agents. |
| Method Name | Request Type | Response Type | Description |
| --------------------- | -------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| IndexInfo | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Count](#payload-v1-Info-Index-Count) | Represent the RPC to get the index information. |
| IndexDetail | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Detail](#payload-v1-Info-Index-Detail) | Represent the RPC to get the index information for each agents. |
| IndexStatistics | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.Statistics](#payload-v1-Info-Index-Statistics) | Represent the RPC to get the index statistics. |
| IndexStatisticsDetail | [.payload.v1.Empty](#payload-v1-Empty) | [.payload.v1.Info.Index.StatisticsDetail](#payload-v1-Info-Index-StatisticsDetail) | Represent the RPC to get the index statistics for each agents. |

<a name="v1_vald_insert-proto"></a>

Expand Down
15 changes: 3 additions & 12 deletions apis/grpc/v1/agent/core/agent_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ func RegisterAgentServer(s grpc.ServiceRegistrar, srv AgentServer) {
}

func _Agent_CreateIndex_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Control_CreateIndexRequest)
if err := dec(in); err != nil {
Expand All @@ -158,10 +155,7 @@ func _Agent_CreateIndex_Handler(
}

func _Agent_SaveIndex_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Empty)
if err := dec(in); err != nil {
Expand All @@ -181,10 +175,7 @@ func _Agent_SaveIndex_Handler(
}

func _Agent_CreateAndSaveIndex_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Control_CreateIndexRequest)
if err := dec(in); err != nil {
Expand Down
15 changes: 3 additions & 12 deletions apis/grpc/v1/discoverer/discoverer_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,7 @@ func RegisterDiscovererServer(s grpc.ServiceRegistrar, srv DiscovererServer) {
}

func _Discoverer_Pods_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Discoverer_Request)
if err := dec(in); err != nil {
Expand All @@ -160,10 +157,7 @@ func _Discoverer_Pods_Handler(
}

func _Discoverer_Nodes_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Discoverer_Request)
if err := dec(in); err != nil {
Expand All @@ -183,10 +177,7 @@ func _Discoverer_Nodes_Handler(
}

func _Discoverer_Services_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Discoverer_Request)
if err := dec(in); err != nil {
Expand Down
10 changes: 2 additions & 8 deletions apis/grpc/v1/filter/egress/egress_filter_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ func RegisterFilterServer(s grpc.ServiceRegistrar, srv FilterServer) {
}

func _Filter_FilterDistance_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Object_Distance)
if err := dec(in); err != nil {
Expand All @@ -140,10 +137,7 @@ func _Filter_FilterDistance_Handler(
}

func _Filter_FilterVector_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Object_Vector)
if err := dec(in); err != nil {
Expand Down
10 changes: 2 additions & 8 deletions apis/grpc/v1/filter/ingress/ingress_filter_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ func RegisterFilterServer(s grpc.ServiceRegistrar, srv FilterServer) {
}

func _Filter_GenVector_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Object_Blob)
if err := dec(in); err != nil {
Expand All @@ -140,10 +137,7 @@ func _Filter_GenVector_Handler(
}

func _Filter_FilterVector_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Object_Vector)
if err := dec(in); err != nil {
Expand Down
5 changes: 1 addition & 4 deletions apis/grpc/v1/mirror/mirror_vtproto.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ func RegisterMirrorServer(s grpc.ServiceRegistrar, srv MirrorServer) {
}

func _Mirror_Register_Handler(
srv any,
ctx context.Context,
dec func(any) error,
interceptor grpc.UnaryServerInterceptor,
srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor,
) (any, error) {
in := new(payload.Mirror_Targets)
if err := dec(in); err != nil {
Expand Down
Loading

0 comments on commit 2b3754d

Please sign in to comment.