doc: fix perf_hooks documentation gaps and inaccuracies#62194
Open
kovan wants to merge 1 commit intonodejs:mainfrom
Open
doc: fix perf_hooks documentation gaps and inaccuracies#62194kovan wants to merge 1 commit intonodejs:mainfrom
kovan wants to merge 1 commit intonodejs:mainfrom
Conversation
- Fix introductory ESM example that references undefined `doSomeLongRunningProcess` and prematurely clears marks - Add missing PerformanceResourceTiming properties: initiatorType, nextHopProtocol, responseStart, deliveryType, responseStatus - Correct PerformanceMark/PerformanceMeasure version metadata from v18.2.0/v16.17.0 to v16.0.0 (introduced in PR nodejs#37136) - Fix histogram.exceeds description: it counts values exceeding the histogram's configured `highest` value, not a "1 hour" threshold - Generalize Histogram property descriptions (min, max, mean, stddev) to not reference "event loop delay" since Histogram is a generic class Fixes: nodejs#40558 Fixes: nodejs#40096 Fixes: nodejs#40723 Fixes: nodejs#55792 Fixes: nodejs#55793 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Audit of
doc/api/perf_hooks.mdfixing several long-standing documentationissues:
Fix introductory ESM example — the example referenced an undefined
doSomeLongRunningProcesscallback and prematurely calledperformance.clearMarks()in the observer, which would cause subsequentperformance.measure()calls to throwAdd 5 missing
PerformanceResourceTimingproperties —initiatorType(added v18.6.0/v16.17.0, PR perf_hooks: add initiatorType getter #43593),nextHopProtocolandresponseStart(added v18.2.0/v16.17.0, PR perf_hooks: add PerformanceResourceTiming #42725),deliveryTypeandresponseStatus(added v22.2.0, PR perf_hooks: add deliveryType and responseStatus fields #51589) areimplemented in
lib/internal/perf/resource_timing.jsbut were absent fromthe docs
Correct
PerformanceMarkversion metadata — introduced in v16.0.0(PR perf_hooks: complete overhaul of the implementation #37136), not v18.2.0/v16.17.0 (which is when PR perf_hooks: fix webperf idlharness #44483 reorganized the
doc sections)
Correct
PerformanceMeasureversion metadata — exported from the modulein v16.7.0 (PR perf_hooks: add ability to fetch performance entries synchronously #39297), not v18.2.0/v16.17.0
Fix
histogram.exceedsdescription — the docs claimed a "1 hour eventloop delay threshold" but the C++ source (
src/histogram-inl.h) showsexceeds_increments whenhdr_record_valuereturns false, i.e. the valueexceeds the histogram's configured
highesttrackable valueFix
requestStartdescription — was incorrectly described as "beforeNode.js receives the first byte of the response" (that's
responseStart);corrected to "before Node.js starts requesting the resource"
Generalize
Histogramproperty descriptions —min,max,mean,stddevdescribed "event loop delay" butHistogramis a generic classalso used by
createHistogram()andtimerify()All version metadata verified against full git history (
git tag --contains).Fixes: #40558
Fixes: #40096
Fixes: #40723
Fixes: #55792
Fixes: #55793