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

DEVPROD-11650 Don't recompute redactions for every Send invocation during test ingestion #8796

Merged
merged 5 commits into from
Mar 10, 2025

Conversation

hadjri
Copy link
Contributor

@hadjri hadjri commented Mar 6, 2025

DEVPROD-11650

Description

The redacting sender sorts the whole list of KV pairs to redact for every .Send, which invokes for every log line. For tasks with many keys to sort (server can have 40+), this sorting operation can be computationally intensive and take up significant time.

Since test log ingestion happens after the task has completed and the expansions will no longer be changing, we can instead precompute the sorted list of redacted KV pairs once on initializing the sender, rather than every time we process a line.

Testing

Ran benchmarking tests on very large log files and confirmed that this change improved the benchmark test runtime performance on local machine (5m -> 1m30s).

@hadjri hadjri requested review from julianedwards and a team March 6, 2025 18:34
Copy link
Contributor

@Kimchelly Kimchelly left a comment

Choose a reason for hiding this comment

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

LGTM mod nits.

// full list of redacted key-value pairs on initialization, or on every
// sender.Send invocation. This should not be set if the redacting sender
// is logging during task runtime, because expansions can change over the course
// of task runtime. It can only be safely set if we're confident that expansions
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove double space if we're

// sender.Send invocation. This should not be set if the redacting sender
// is logging during task runtime, because expansions can change over the course
// of task runtime. It can only be safely set if we're confident that expansions
// will no longer be changing. This flag exists to improve the performance of test log ingestion.
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be more appropriate to move this last comment about the flag's use case (specifically about test log ingestion) over the line where it's set and just explain here that it's a performance optimization.

@hadjri hadjri merged commit 89695f8 into evergreen-ci:main Mar 10, 2025
6 of 7 checks passed
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.

3 participants