-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Expose HitCount and HitLineCount to CPUProfileNode #285
base: master
Are you sure you want to change the base?
Conversation
@@ -17,6 +17,12 @@ type CPUProfileNode struct { | |||
// The number of the column where the function originates. | |||
columnNumber int | |||
|
|||
// The number of samples recorded in the function | |||
hitCount uint |
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.
Would you be open to using the comment from the v8 header file for these?
i.e.
// The count of samples where the function was currently executing.
hitCount uint
// The number of the function's source lines that collect the samples.
hitLineCount uint
// Returns total number of lines inside the function recording samples | ||
func (c *CPUProfileNode) GetHitLineCount() uint { | ||
return c.hitLineCount | ||
} |
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.
Same for the getters ^
The changes look good.
|
Codecov Report
@@ Coverage Diff @@
## master #285 +/- ##
==========================================
- Coverage 95.86% 95.54% -0.32%
==========================================
Files 17 17
Lines 580 584 +4
==========================================
+ Hits 556 558 +2
- Misses 15 17 +2
Partials 9 9
Continue to review full report at Codecov.
|
This exposes hitCount and hitLineCount from v8's cpuprofile node. It's useful in order to be able to see relative percentages of time spent in a v8 function and its descendants, although computing total time is left up to the presentation implementation.
Sample implementation: