[Profiler] Send only activated profilers values in profile#3337
Merged
Conversation
gleocadie
approved these changes
Oct 11, 2022
| size_t Sample::ValuesCount = 16; // should be set BEFORE any sample gets created | ||
|
|
||
|
|
||
| //s |
Comment on lines
+34
to
+39
| _values.reserve(ValuesCount); | ||
| for (size_t i = 0; i < ValuesCount; i++) | ||
| { | ||
| _values.push_back(0); | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
you can use resize instead. Or the ctor which takes the count as parameter https://en.cppreference.com/w/cpp/container/vector/vector
…only_values_in_pprof
…only_values_in_pprof
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
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.
Summary of changes
Send only activated profilers values in profile
Reason for change
For back end metrics computation, it is not possible to figure out which value is 0 because the corresponding profiler is disabled or no value. With this change, only values of activated profilers will be available in profiles.
Implementation details
Per profiler values offset is computed when the profilers are enabled. These offset are passed down to the collector base class to allow transformation of raw data into corresponding value slots in profiles.
Test coverage
Updated all test cases and adding dedicated ones for wall time
Other details