-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Implement ngt Statistics API #2533
Conversation
Important Review skippedIgnore keyword(s) in the title. Ignored keywords (3)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
[CHATOPS:HELP] ChatOps commands.
|
917534d
to
ebd278c
Compare
Deploying vald with Cloudflare Pages
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2533 +/- ##
==========================================
- Coverage 18.43% 7.90% -10.54%
==========================================
Files 566 162 -404
Lines 66342 35872 -30470
==========================================
- Hits 12232 2835 -9397
+ Misses 53320 32736 -20584
+ Partials 790 301 -489 ☔ View full report in Codecov by Sentry. |
164ac1a
to
826cd8e
Compare
cfbaf2f
to
2b3754d
Compare
99cfe7e
to
597f8e2
Compare
[WARNING:INTCFG] Changes in |
6047dc0
to
3df1ba1
Compare
496be06
to
c460b18
Compare
50f5c99
to
bb96c49
Compare
return merged | ||
} | ||
|
||
var indegrees, outdegrees []int32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Consider pre-allocating indegrees
(prealloc)
} | ||
|
||
var indegrees, outdegrees []int32 | ||
var indegreeCounts [][]int64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Consider pre-allocating indegreeCounts
(prealloc)
|
||
var indegrees, outdegrees []int32 | ||
var indegreeCounts [][]int64 | ||
var outdegreeHistograms, indegreeHistograms [][]uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Consider pre-allocating outdegreeHistograms
(prealloc)
|
||
func mergeInfoIndexStatistics( | ||
stats map[string]*payload.Info_Index_Statistics, | ||
) *payload.Info_Index_Statistics { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
mergeInfoIndexStatistics - result 0 (*github.com/vdaas/vald/apis/grpc/v1/payload.Info_Index_Statistics) is always nil (unparam)
// type want struct{} | ||
// type test struct { | ||
// name string | ||
// want want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Duplicate words (want) found (dupword)
// type fields struct { | ||
// eg errgroup.Group | ||
// dataset *config.BenchmarkDataset | ||
// jobType jobType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Duplicate words (jobType) found (dupword)
// type fields struct { | ||
// eg errgroup.Group | ||
// dataset *config.BenchmarkDataset | ||
// jobType jobType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Duplicate words (jobType) found (dupword)
// type fields struct { | ||
// eg errgroup.Group | ||
// dataset *config.BenchmarkDataset | ||
// jobType jobType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Duplicate words (jobType) found (dupword)
@@ -61,8 +158,8 @@ func New(n service.NGT) metrics.Metric { | |||
} | |||
} | |||
|
|||
func (n *ngtMetrics) View() ([]metrics.View, error) { | |||
return []metrics.View{ | |||
func (n *ngtMetrics) View() (mv []metrics.View, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Function name: View, Cyclomatic Complexity: 2, Halstead Volume: 5766.49, Maintainability Index: 17 (maintidx)
} | ||
|
||
func (n *ngtMetrics) Register(m metrics.Meter) error { | ||
indexCount, err := m.Int64ObservableGauge( | ||
func (n *ngtMetrics) Register(m metrics.Meter) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Function name: Register, Cyclomatic Complexity: 51, Halstead Volume: 12248.73, Maintainability Index: 4 (maintidx)
739fc7a
to
6717995
Compare
Signed-off-by: kpango <kpango@vdaas.org>
6717995
to
714027d
Compare
Description
Summary
This pull request introduces several significant updates and enhancements, primarily focusing on adding new API functionalities for index statistics and improving observability metrics.
The _test.go and pb.go diffs are just re-generated please ignore them.
Changes
Protobuf Updates:
Info.Index.Statistics
toapis/proto/v1/payload/payload.proto
.IndexStatistics
andIndexStatisticsDetail
APIs inapis/proto/v1/vald/index.proto
to returnInfo.Index.Statistics
.Handler Implementations:
IndexStatistics
andIndexStatisticsDetail
API handlers inpkg/gateway/lb/handler/grpc/handler.go
.pkg/agent/core/ngt/service/ngt.go
.Algorithm Enhancements:
GraphStatistics
struct andGetGraphStatistics(m statisticsType) (stats *GraphStatistics, err error)
function ininternal/core/algorithm/ngt/ngt.go
to enable retrieval of index statistics.GraphStatistics
postCreateIndex
based on options inpkg/agent/core/ngt/service/ngt.go
.Metrics Export:
GraphStatistics
metrics ininternal/observability/metrics/agent/core/ngt/ngt.go
.Int64ObservableGauge
andFloat64ObservableGauge
ininternal/observability/metrics/metrics.go
.Configuration and Formatting:
.github/workflows/format.yml
to add ignore settings forFormat and license
.Makefile
underformat/go
to include formatting of artifacts generated fromProto
.Additional Notes
Related Issue
Versions
Checklist
Special notes for your reviewer