-
Notifications
You must be signed in to change notification settings - Fork 2
Add range metrics and splitting engine with admin gRPC endpoints #210
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
Conversation
| import "testing" | ||
|
|
||
| // Test range statistics collection and split triggering. | ||
| func TestRangeStatsAndSplit(t *testing.T) { |
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 🐶
calculated cyclomatic complexity for function TestRangeStatsAndSplit is 12, max is 10 (cyclop)
| package distribution | ||
|
|
||
| import ( | ||
| "sync" |
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 🐶
File is not properly formatted (gci)
|
|
||
| // Test range statistics collection and split triggering. | ||
| func TestRangeStatsAndSplit(t *testing.T) { | ||
| var notified bool |
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 🐶
File is not properly formatted (gci)
| // function is invoked whenever a range split occurs. | ||
| func NewEngine(threshold int, notify func(left, right Range)) *Engine { | ||
| return &Engine{ | ||
| ranges: []Range{{Start: "", End: string(rune(0xffff))}}, |
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 🐶
Magic number: 0xffff, in detected (mnd)
| s = start[0] | ||
| } | ||
| e := byte('z') | ||
| if len(end) > 0 && end != string(rune(0xffff)) { |
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 🐶
Magic number: 0xffff, in detected (mnd)
| if len(end) > 0 && end != string(rune(0xffff)) { | ||
| e = end[0] | ||
| } | ||
| m := s + (e-s)/2 |
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 🐶
Magic number: 2, in detected (mnd)
Summary
Testing
go test ./distribution -run Test -count=1https://chatgpt.com/codex/tasks/task_e_689871cad050832498b5c2fddf27a073