Skip to content

Record-Trace: Enable duration and memory limits#291

Merged
beaubelgrave merged 1 commit into
mainfrom
users/beaub/mem_time_record_args
Jun 16, 2026
Merged

Record-Trace: Enable duration and memory limits#291
beaubelgrave merged 1 commit into
mainfrom
users/beaub/mem_time_record_args

Conversation

@beaubelgrave

Copy link
Copy Markdown
Collaborator

We have scenarios where record-trace should automatically stop as if a user hit control-c when either a duration or memory limit is hit.

Add --duration and --max-memory arguments to allow these scenarios.

Honor duration within the parse_until callback directly.

Spawn a thread for memory monitoring, using OS specific functions. This ensures that memory monitoring does not affect the consumer threads ability to keep up with data rates.

Tested on both Windows and Linux manually for both --duration and --max-memory arguments, ensuring they stopped the trace at the correct points.

We have scenarios where record-trace should automatically stop as if a
user hit control-c when either a duration or memory limit is hit.

Add --duration and --max-memory arguments to allow these scenarios.

Honor duration within the parse_until callback directly.

Spawn a thread for memory monitoring, using OS specific functions. This
ensures that memory monitoring does not affect the consumer threads
ability to keep up with data rates.

Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
@beaubelgrave beaubelgrave force-pushed the users/beaub/mem_time_record_args branch from 5e80e2d to cf850b8 Compare June 15, 2026 23:28
@beaubelgrave beaubelgrave requested a review from brianrob June 15, 2026 23:30

@brianrob brianrob left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks!

@beaubelgrave beaubelgrave merged commit ebe139c into main Jun 16, 2026
19 checks passed
@beaubelgrave beaubelgrave deleted the users/beaub/mem_time_record_args branch June 16, 2026 17:48
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.

Add max memory option in record-trace Add duration support in record-trace

2 participants