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

Performance optimization for live debugging feature #2294

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ravishankar15
Copy link
Contributor

PR Description

Which issue(s) this PR fixes

Fixes #974

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added

@@ -164,7 +165,7 @@ func TestJSONLabelsStage(t *testing.T) {
"[IN]: timestamp: 2020-11-15T02:08:41-07:00, entry: {\"log\":\"log message\\n\",\"stream\":\"stderr\",\"time\":\"2019-04-30T02:12:41.8443515Z\",\"extra\":\"{\\\"user\\\":\\\"smith\\\"}\"}, labels: {filename=\"/var/log/pods/agent/agent/1.log\", foo=\"bar\"}",
"[OUT]: timestamp: 2019-04-30T02:12:41.8443515Z, entry: {\"log\":\"log message\\n\",\"stream\":\"stderr\",\"time\":\"2019-04-30T02:12:41.8443515Z\",\"extra\":\"{\\\"user\\\":\\\"smith\\\"}\"}, labels: {filename=\"/var/log/pods/agent/agent/1.log\", foo=\"bar\", stream=\"stderr\", ts=\"2019-04-30T02:12:41.8443515Z\", user=\"smith\"}",
}
require.Equal(t, expectedLiveDebuggingLog, liveDebuggingLog.Get())
assert.ElementsMatch(t, expectedLiveDebuggingLog, liveDebuggingLog.Get())
Copy link
Contributor

Choose a reason for hiding this comment

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

this test is not flaky on main, why would it sometimes not be ordered with your changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

yes but we need to figure out why that's the case. The order is important, if you receive the "out" before the "in" then it's confusing in the UI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @wildum I missed adding the channel size in the tests have added the same. But I am not sure if that is the reason for failure. I checked the code and logic seems to be good I don't see any race conditions. Like you mentioned the IN and OUT are published in order and should be received in order. I tried to run this in local a couple of times frequently with the channel size fix it seems stable. Can you help me see if I am missing any race condition on this test failure ?

Copy link
Contributor

Choose a reason for hiding this comment

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

that's weird, I can't also reproduce it anymore, even without the buffer size 🤔
But in the meantime I ran some tests and even under heavy load a small buffer size was not dropping data. The front-end will have trouble to keep up before the buffer is threatened. I think that it's not worth it to make it a parameter in the end. We can keep the flushing at regular interval though but for the buffer I would just remove the TODO comment. Sorry for the trouble

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ohh, You mean we should remove the config buffer_stream_size ? and have only the flush interval changes ? or just remove the config changes for the tests made in this commit

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we should remove the config buffer_stream_size because it doesn't seem necessary in the end

@ravishankar15 ravishankar15 force-pushed the live-debug-performance branch 2 times, most recently from d6f8972 to 574403a Compare December 19, 2024 17:48
Copy link
Contributor

@wildum wildum left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

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

Successfully merging this pull request may close these issues.

Consider performance optimizations
2 participants