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

WIP feat(collector): improve remote host collector speed #1673

Closed
wants to merge 21 commits into from

Conversation

DexterYan
Copy link
Member

Description, Motivation and Context

Please include a summary of the change or what problem it solves. Please also include relevant motivation and context.

Checklist

  • New and existing tests pass locally with introduced changes.
  • Tests for the changes have been added (for bug fixes / features)
  • The commit message(s) are informative and highlight any breaking changes
  • Any documentation required has been added/updated. For changes to https://troubleshoot.sh/ create a PR here

Does this PR introduce a breaking change?

  • Yes
  • No

@DexterYan DexterYan requested a review from a team as a code owner November 4, 2024 21:53
@DexterYan DexterYan added the type::feature New feature or request label Nov 4, 2024
results[file] = []byte(data)
}

time.Sleep(1 * time.Second)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this sleep?

}

// wait for log stream to catch up
time.Sleep(1 * time.Second)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sleep isn't great here. Better to wait for the object. This will be brittle

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Agree, I am trying to use polling method. However, the previous PR will be refactored. This PR will be on hold.

@DexterYan DexterYan force-pushed the dx/sc-114420/daemonset branch from 3c8db66 to 3f7b532 Compare November 5, 2024 10:44
Comment on lines 355 to 364
for _, pod := range pods.Items {
eg.Go(func() error {
// TODO: set timeout waiting
if err := waitForPodRunning(ctx, clientset, &pod); err != nil {
return err
}

results := map[string][]byte{}
for _, collectorSpec := range hostCollectors {
collector, ok := collect.GetHostCollector(collectorSpec, bundlePath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the reporting and the progress updates accurate if the flow is:

for pod in pods:
    run each collector

or should it be:

for collector in collectors:
    run in each pod

@DexterYan DexterYan changed the title feat(collector): improve remote host collector speed WIP feat(collector): improve remote host collector speed Nov 5, 2024
@DexterYan DexterYan marked this pull request as draft November 5, 2024 19:26
@DexterYan DexterYan closed this Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants