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

agents: refactor profiling on ZmqAgent #90

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

santigimeno
Copy link
Member

@santigimeno santigimeno commented Feb 26, 2024

In preparation of adding support for heap profiling and sampling, extract the CPU Profiling logic into a 2 generic templated functions: start_prof() and got_prof() which can be configured via specific policies. Create the CPUProfilePolicy for now. Later on we will add policies for heap profiling and sampling.
Encapsulate the state of every profile type into a ProfileState.

@santigimeno santigimeno self-assigned this Feb 26, 2024
@santigimeno santigimeno force-pushed the santi/profile_templates branch 2 times, most recently from 3cf9f96 to 7e93975 Compare February 26, 2024 21:46
Copy link
Contributor

@trevnorris trevnorris left a comment

Choose a reason for hiding this comment

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

Great stuff. I'll approve, but please fix this before landing:

../agents/zmq/src/zmq_agent.h:739:29: warning: private field 'nr_profiles_' is not used [-Wunused-private-field]
  std::atomic<unsigned int> nr_profiles_;

@santigimeno santigimeno force-pushed the santi/profile_templates branch from 7e93975 to 0266028 Compare February 27, 2024 06:43
In preparation of adding support for heap profiling and sampling,
extract the CPU Profiling logic into a 2 generic templated functions:
`start_prof()` and `got_prof()` which can be configured via specific
policies. Create the `CPUProfilePolicy` for now. Later on we will add
policies for heap profiling and sampling.
Encapsulate the state of every profile type into a `ProfileState`.

PR-URL: #90
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
@santigimeno santigimeno force-pushed the santi/profile_templates branch from 0266028 to 5dd46b2 Compare February 27, 2024 06:47
@santigimeno santigimeno merged commit 5dd46b2 into node-v20.x-nsolid-v5.x Feb 27, 2024
11 of 14 checks passed
@santigimeno santigimeno deleted the santi/profile_templates branch February 27, 2024 06:48
trevnorris pushed a commit that referenced this pull request Feb 28, 2024
In preparation of adding support for heap profiling and sampling,
extract the CPU Profiling logic into a 2 generic templated functions:
`start_prof()` and `got_prof()` which can be configured via specific
policies. Create the `CPUProfilePolicy` for now. Later on we will add
policies for heap profiling and sampling.
Encapsulate the state of every profile type into a `ProfileState`.

PR-URL: #90
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
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.

2 participants