lib,src: improve histogram implementation · nodejs/node@753033c · GitHub
Skip to content

Commit 753033c

Browse files
jasnelladuh95
authored andcommitted
lib,src: improve histogram implementation
Several improvements: 1. In histogram-inl, Add previous locked only this->mutex while reading the other's fields unsafely. 2. In histogram.cc, PrepareCB now uses ContainerOf 3. In histogram.cc, BigInt value range is checked 4. In histogram.js, simplified impl and reduced duplication 5. In event_loop_delay.js, use a more consistent constructor Adds new analytical APIs to Histogram * histogram.ccdf(value) * histogram.cdf(value) * histogram.countAt(value) * histogram.ksTest(other) * histogram.kurtosis * histogram.linearBuckets(stepSize) * histogram.logBuckets(first, base) * histogram.percentilesAt(percentiles) * histogram.shewness On RecordableHistogram * histogram.recordCorrected(val, expectedInterval) * histogram.subtract(other) Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode/Opus PR-URL: #65024 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 4018f3a commit 753033c

7 files changed

Lines changed: 1530 additions & 156 deletions

File tree

doc/api/perf_hooks.md

Lines changed: 240 additions & 0 deletions

0 commit comments

Comments
 (0)