Skip to content
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

Merged
merged 1 commit into from
May 17, 2016

Conversation

timstclair
Copy link
Contributor

No description provided.

@k8s-bot
Copy link
Collaborator

k8s-bot commented Apr 25, 2016

Jenkins GCE e2e

Build/test passed for commit 0973c85.

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.
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@k8s-bot
Copy link
Collaborator

k8s-bot commented May 16, 2016

Jenkins GCE e2e

Build/test failed for commit 0973c85.

@timstclair timstclair assigned vishh and unassigned jimmidyson May 16, 2016
@timstclair
Copy link
Contributor Author

Reassigning to Vish - I'd like to get this in to k8s v1.3.

@timstclair timstclair added this to the Kubernetes v1.3 milestone May 17, 2016
@timstclair
Copy link
Contributor Author

@k8s-bot test this

@jimmidyson
Copy link
Collaborator

Sorry this slipped off my radar. LGTM.

@k8s-bot
Copy link
Collaborator

k8s-bot commented May 17, 2016

Jenkins GCE e2e

Build/test passed for commit 0973c85.

@timstclair timstclair assigned jimmidyson and unassigned vishh May 17, 2016
@timstclair
Copy link
Contributor Author

Thanks! I had heard a rumor you weren't working on cAdvisor anymore.

@timstclair timstclair merged commit 4381a51 into google:master May 17, 2016
@jimmidyson
Copy link
Collaborator

@timstclair Rumours... I'm still around, just not contributing as much as I'd like to be able to right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants