-
Notifications
You must be signed in to change notification settings - Fork 8
Continuous Profiling Implementation #282
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e995322 to
4870740
Compare
juanarbol
approved these changes
Apr 1, 2025
Contributor
juanarbol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
c19d441 to
f18e72e
Compare
Replace manual message handling with AsyncTSQueue for profile data. Remove initialize() method as initialization is now handled in constructor. Simplify profile callback implementation. Remove process_profiles() as AsyncTSQueue handles this automatically. Update ZMQ and gRPC agents to remove initialize() calls.
Add is_running checks to all public methods. Prevent operations on deleted profiler instances. Add early return guards to TakeCpuProfile, StopProfiling, and StopProfilingSync. Improve stability during shutdown sequence.
Add NSOLID_CONT_CPU_PROFILE environment variable support. Add NSOLID_CONT_CPU_PROFILE_INTERVAL environment variable support. Implement contCpuProfile and contCpuProfileInterval config options. Set default interval to 30000ms (30 seconds). Update initializeConfig and updateConfig functions.
Create and initialize ContinuousProfiler in EnvList. Add configuration handling for continuous profiling options. Update EnvList to enable/disable profiling based on config. Add proper cleanup in shutdown sequence. Expose ContinuousProfiler through GetContinuousProfiler() method.
Add test-nsolid-config-continuous-profiling.js for API configuration. Add test-nsolid-config-continuous-profiling-env.js for environment variables.
Add ExportContinuousProfile RPC to nsolid_service.proto. Add start_ts and end_ts fields to Asset message.
Add AssetStreamRpcType enum to differentiate between RPC types. Modify AssetStream constructor to accept RPC type parameter. Update Write method to support both ExportAsset and ExportContinuousProfile. Add safety assertion for WritesDone method.
Add continuous profiler callback and queue. Register hook with ContinuousProfiler during agent startup. Implement got_continuous_profile method for handling profile data. Add conflict resolution between manual and continuous profiling. Update profile timestamp handling for better accuracy. Add proper cleanup in shutdown sequence.
Add test-grpc-continuous-profile.mjs for testing continuous profiling. Update gRPC agent server test fixture. Test profile data transmission and format. Verify continuous profiling configuration options. Please enter the commit message for your changes. Lines starting.
4870740 to
e638bb7
Compare
santigimeno
added a commit
that referenced
this pull request
Apr 14, 2025
Replace manual message handling with AsyncTSQueue for profile data. Remove initialize() method as initialization is now handled in constructor. Simplify profile callback implementation. Remove process_profiles() as AsyncTSQueue handles this automatically. Update ZMQ and gRPC agents to remove initialize() calls. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Apr 14, 2025
PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Apr 14, 2025
Add is_running checks to all public methods. Prevent operations on deleted profiler instances. Add early return guards to TakeCpuProfile, StopProfiling, and StopProfilingSync. Improve stability during shutdown sequence. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Apr 14, 2025
Add NSOLID_CONT_CPU_PROFILE environment variable support. Add NSOLID_CONT_CPU_PROFILE_INTERVAL environment variable support. Implement contCpuProfile and contCpuProfileInterval config options. Set default interval to 30000ms (30 seconds). Update initializeConfig and updateConfig functions. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Apr 14, 2025
Create and initialize ContinuousProfiler in EnvList. Add configuration handling for continuous profiling options. Update EnvList to enable/disable profiling based on config. Add proper cleanup in shutdown sequence. Expose ContinuousProfiler through GetContinuousProfiler() method. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Apr 14, 2025
Add test-nsolid-config-continuous-profiling.js for API configuration. Add test-nsolid-config-continuous-profiling-env.js for environment variables. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Apr 14, 2025
Add ExportContinuousProfile RPC to nsolid_service.proto. Add start_ts and end_ts fields to Asset message. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Apr 14, 2025
Add AssetStreamRpcType enum to differentiate between RPC types. Modify AssetStream constructor to accept RPC type parameter. Update Write method to support both ExportAsset and ExportContinuousProfile. Add safety assertion for WritesDone method. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 12, 2025
Create and initialize ContinuousProfiler in EnvList. Add configuration handling for continuous profiling options. Update EnvList to enable/disable profiling based on config. Add proper cleanup in shutdown sequence. Expose ContinuousProfiler through GetContinuousProfiler() method. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 12, 2025
Add test-nsolid-config-continuous-profiling.js for API configuration. Add test-nsolid-config-continuous-profiling-env.js for environment variables. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 12, 2025
Add ExportContinuousProfile RPC to nsolid_service.proto. Add start_ts and end_ts fields to Asset message. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 12, 2025
Add AssetStreamRpcType enum to differentiate between RPC types. Modify AssetStream constructor to accept RPC type parameter. Update Write method to support both ExportAsset and ExportContinuousProfile. Add safety assertion for WritesDone method. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 12, 2025
Add continuous profiler callback and queue. Register hook with ContinuousProfiler during agent startup. Implement got_continuous_profile method for handling profile data. Add conflict resolution between manual and continuous profiling. Update profile timestamp handling for better accuracy. Add proper cleanup in shutdown sequence. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 12, 2025
Add test-grpc-continuous-profile.mjs for testing continuous profiling. Update gRPC agent server test fixture. Test profile data transmission and format. Verify continuous profiling configuration options. Please enter the commit message for your changes. Lines starting. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 15, 2025
PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 15, 2025
Add NSOLID_CONT_CPU_PROFILE environment variable support. Add NSOLID_CONT_CPU_PROFILE_INTERVAL environment variable support. Implement contCpuProfile and contCpuProfileInterval config options. Set default interval to 30000ms (30 seconds). Update initializeConfig and updateConfig functions. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 15, 2025
Create and initialize ContinuousProfiler in EnvList. Add configuration handling for continuous profiling options. Update EnvList to enable/disable profiling based on config. Add proper cleanup in shutdown sequence. Expose ContinuousProfiler through GetContinuousProfiler() method. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 15, 2025
Add test-nsolid-config-continuous-profiling.js for API configuration. Add test-nsolid-config-continuous-profiling-env.js for environment variables. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 15, 2025
Add ExportContinuousProfile RPC to nsolid_service.proto. Add start_ts and end_ts fields to Asset message. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 15, 2025
Add AssetStreamRpcType enum to differentiate between RPC types. Modify AssetStream constructor to accept RPC type parameter. Update Write method to support both ExportAsset and ExportContinuousProfile. Add safety assertion for WritesDone method. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 15, 2025
Add continuous profiler callback and queue. Register hook with ContinuousProfiler during agent startup. Implement got_continuous_profile method for handling profile data. Add conflict resolution between manual and continuous profiling. Update profile timestamp handling for better accuracy. Add proper cleanup in shutdown sequence. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
May 15, 2025
Add test-grpc-continuous-profile.mjs for testing continuous profiling. Update gRPC agent server test fixture. Test profile data transmission and format. Verify continuous profiling configuration options. Please enter the commit message for your changes. Lines starting. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 25, 2025
PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 25, 2025
Add NSOLID_CONT_CPU_PROFILE environment variable support. Add NSOLID_CONT_CPU_PROFILE_INTERVAL environment variable support. Implement contCpuProfile and contCpuProfileInterval config options. Set default interval to 30000ms (30 seconds). Update initializeConfig and updateConfig functions. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 25, 2025
Create and initialize ContinuousProfiler in EnvList. Add configuration handling for continuous profiling options. Update EnvList to enable/disable profiling based on config. Add proper cleanup in shutdown sequence. Expose ContinuousProfiler through GetContinuousProfiler() method. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 25, 2025
Add test-nsolid-config-continuous-profiling.js for API configuration. Add test-nsolid-config-continuous-profiling-env.js for environment variables. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 25, 2025
Add ExportContinuousProfile RPC to nsolid_service.proto. Add start_ts and end_ts fields to Asset message. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 25, 2025
Add AssetStreamRpcType enum to differentiate between RPC types. Modify AssetStream constructor to accept RPC type parameter. Update Write method to support both ExportAsset and ExportContinuousProfile. Add safety assertion for WritesDone method. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 25, 2025
Add continuous profiler callback and queue. Register hook with ContinuousProfiler during agent startup. Implement got_continuous_profile method for handling profile data. Add conflict resolution between manual and continuous profiling. Update profile timestamp handling for better accuracy. Add proper cleanup in shutdown sequence. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 25, 2025
Add test-grpc-continuous-profile.mjs for testing continuous profiling. Update gRPC agent server test fixture. Test profile data transmission and format. Verify continuous profiling configuration options. Please enter the commit message for your changes. Lines starting. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 26, 2025
PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]> PR-URL: #359 Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 26, 2025
Add NSOLID_CONT_CPU_PROFILE environment variable support. Add NSOLID_CONT_CPU_PROFILE_INTERVAL environment variable support. Implement contCpuProfile and contCpuProfileInterval config options. Set default interval to 30000ms (30 seconds). Update initializeConfig and updateConfig functions. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]> PR-URL: #359 Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 26, 2025
Create and initialize ContinuousProfiler in EnvList. Add configuration handling for continuous profiling options. Update EnvList to enable/disable profiling based on config. Add proper cleanup in shutdown sequence. Expose ContinuousProfiler through GetContinuousProfiler() method. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]> PR-URL: #359 Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 26, 2025
Add test-nsolid-config-continuous-profiling.js for API configuration. Add test-nsolid-config-continuous-profiling-env.js for environment variables. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]> PR-URL: #359 Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 26, 2025
Add ExportContinuousProfile RPC to nsolid_service.proto. Add start_ts and end_ts fields to Asset message. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]> PR-URL: #359 Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 26, 2025
Add AssetStreamRpcType enum to differentiate between RPC types. Modify AssetStream constructor to accept RPC type parameter. Update Write method to support both ExportAsset and ExportContinuousProfile. Add safety assertion for WritesDone method. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]> PR-URL: #359 Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 26, 2025
Add continuous profiler callback and queue. Register hook with ContinuousProfiler during agent startup. Implement got_continuous_profile method for handling profile data. Add conflict resolution between manual and continuous profiling. Update profile timestamp handling for better accuracy. Add proper cleanup in shutdown sequence. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]> PR-URL: #359 Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno
added a commit
that referenced
this pull request
Aug 26, 2025
Add test-grpc-continuous-profile.mjs for testing continuous profiling. Update gRPC agent server test fixture. Test profile data transmission and format. Verify continuous profiling configuration options. Please enter the commit message for your changes. Lines starting. PR-URL: #282 Reviewed-By: Juan José Arboleda <[email protected]> PR-URL: #359 Reviewed-By: Rafael Gonzaga <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continuous Profiling Implementation
This PR implements continuous profiling capabilities in N|Solid, allowing automatic collection of CPU profiles at configurable intervals.
Key Changes
Core Implementation:
ContinuousProfilerclass to manage automatic profile collectionNSolidCPUProfilerwith improved stability checks and shutdown handlingConfiguration Options:
NSOLID_CONT_CPU_PROFILE- Enable/disable continuous CPU profilingNSOLID_CONT_CPU_PROFILE_INTERVAL- Set interval between profiles (default: 30s)contCpuProfilecontCpuProfileIntervalgRPC Agent Support:
ExportContinuousProfileRPC to the service protocolAssetStreamto support continuous profile data transmissionTesting:
Technical Details
AsyncTSQueuefor improved reliability