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

Functionality aside from UseProfiler()? #21

Open
christophwille opened this issue Jan 20, 2025 · 6 comments
Open

Functionality aside from UseProfiler()? #21

christophwille opened this issue Jan 20, 2025 · 6 comments
Assignees
Labels
early access enhancement New feature or request

Comments

@christophwille
Copy link

Is there anything? Eg so I can say in code "Start profiler when memory > 40%" or "Start immediately and trace until minute 3"

Chris

@xiaomi7732
Copy link
Member

Hey @christophwille , will this satisfy what you are looking for:

Image

You shall be able to do Profile Now and combine it with the memory trigger.

@christophwille
Copy link
Author

I know those, but: I want to ship the container, activated with C# (Use case: container startup is immediately stressing CPU and memory). Also I'd like to say stop the profile & upload (Use case: I know that ten seconds later the container crashes and the upload won't succeed any more if I do it later)

@xiaomi7732 xiaomi7732 self-assigned this Jan 22, 2025
@xiaomi7732 xiaomi7732 added enhancement New feature or request early access labels Jan 22, 2025
@xiaomi7732
Copy link
Member

Ah, let me confirm I understand you, this time :-). What you want is capabilities to run profiler by code. Some scenarios like:

  1. Run Profiler for a given period.
  2. Trigger Profiler on conditions.

So, you are looking for APIs like this (pseudo code):

// _profilerService is injected
_profilerService.StartProfiler(duration: TimeSpan.FromSeconds(30)); // Run profiler, by code, for 30 seconds.

// Or something like:

if (memoryUsage > .7)
{
    profilerService.StartProfiler(duration: TimeSpan.FromSeconds(15));
}

Does that sound right?

@christophwille
Copy link
Author

Yes, exactly those are the scenarios I outlined.

Additionally, it would be nice to have a "manual" StopProfiler() capability - eg when I know that some operation I wanted to profile is done (background service, ...)

@xiaomi7732
Copy link
Member

@christophwille I see. Won't that been an issue if end up having huge trace files because the condition never met to stop the profiler? :-)

@christophwille
Copy link
Author

Well, an option to say "and btw, collect a maximum of X MiB and then stop" would also be nice to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
early access enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants