src,lib: add performance.uvMetricsInfo#54413
Merged
Merged
Conversation
This commit exposes a new API to the perf_hooks.performance module. This wraps uv_metrics_info into performance.uvMetricsInfo() function.
trevnorris
reviewed
Aug 16, 2024
trevnorris
left a comment
Contributor
There was a problem hiding this comment.
I really appreciate you doing this. Thanks very much.
avivkeller
reviewed
Aug 16, 2024
tniessen
reviewed
Aug 17, 2024
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
Collaborator
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #54413 +/- ##
==========================================
+ Coverage 87.10% 87.31% +0.21%
==========================================
Files 648 649 +1
Lines 182215 182783 +568
Branches 34955 35046 +91
==========================================
+ Hits 158712 159606 +894
+ Misses 16789 16465 -324
+ Partials 6714 6712 -2
|
benjamingr
approved these changes
Aug 17, 2024
H4ad
approved these changes
Aug 19, 2024
H4ad
left a comment
Member
There was a problem hiding this comment.
LGTM with some non-blocking comments.
Comment on lines
+271
to
+283
| Local<Object> obj = Object::New(env->isolate()); | ||
| obj->Set(env->context(), | ||
| env->loop_count(), | ||
| Integer::NewFromUnsigned(env->isolate(), metrics.loop_count)) | ||
| .Check(); | ||
| obj->Set(env->context(), | ||
| env->events(), | ||
| Integer::NewFromUnsigned(env->isolate(), metrics.events)) | ||
| .Check(); | ||
| obj->Set(env->context(), | ||
| env->events_waiting(), | ||
| Integer::NewFromUnsigned(env->isolate(), metrics.events_waiting)) | ||
| .Check(); |
Member
There was a problem hiding this comment.
Just a note for the future optimization: maybe we should use a buffer to store these values to avoid creating and returning js objects from c++.
Member
Author
There was a problem hiding this comment.
Yeah, I have plans to return a typed array and build the object in JS land. I'll do it in a follow up PR.
RafaelGSS
force-pushed
the
add-uv-metrics-loop
branch
from
August 20, 2024 16:38
6654a2b to
c1385ed
Compare
H4ad
approved these changes
Aug 20, 2024
Collaborator
jasnell
approved these changes
Aug 20, 2024
jasnell
approved these changes
Aug 20, 2024
Merged
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.
This commit exposes a new API to the perf_hooks.performance module. This wraps uv_metrics_info into
performance.uvMetricsInfo() function.
cc: @trevnorris