-
Notifications
You must be signed in to change notification settings - Fork 725
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
*: add trend api. #881
*: add trend api. #881
Conversation
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.
LGTM
histories = append(histories, OperatorHistory{ | ||
FinishTime: now, | ||
From: removePeerStores[i], | ||
To: addPeerStores[i], |
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.
I think there is no order guarantee.
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.
Yes, in fact we do not care about the order, only the changing trend.
if stats == nil { | ||
return | ||
} | ||
if stat, ok := stats[storeID]; ok { |
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.
Not thread-safe here by design?
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.
It's safe as each request are accessing different copy.
server/coordinator.go
Outdated
op := elem.Value.(*schedule.Operator) | ||
if op.Kind()&mask != 0 { | ||
operators = append(operators, op) | ||
var histories []schedule.OperatorHistory |
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.
histories := make( []schedule.OperatorHistory, 0, c.histories.Len())
Len() is O(1)
LGTM |
It's for visualization of cluster's activities.
Usage example: