-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Optimize TimedStore to avoid sort on every data add #1242
Conversation
if len(self.buffer) == 0 || !timestamp.Before(self.buffer[len(self.buffer)-1].timestamp) { | ||
self.buffer = append(self.buffer, data) | ||
} else { | ||
// Data is out of order; insert it in the correct position. |
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.
What causes this to happen?
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.
Creation events for containers that were running before cAdvisor started.
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.
Can we only do this once when starting & remove the need for this check when running normally?
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'd rather not. I'm not positive there aren't any other times that events could arrive out of order, and I think the "common case" check makes the cost of this very low.
Reassigning to Vish - I'd like to get this in to k8s v1.3. |
@k8s-bot test this |
Sorry this slipped off my radar. LGTM. |
Thanks! I had heard a rumor you weren't working on cAdvisor anymore. |
@timstclair Rumours... I'm still around, just not contributing as much as I'd like to be able to right now. |
No description provided.