push
github
507 of 560 branches covered (90.54%)
Branch coverage included in aggregate %.
348 of 363 new or added lines in 9 files covered. (95.87%)
2211 of 2311 relevant lines covered (95.67%)
381.92 hits per line
|
import { createHistogram } from 'node:perf_hooks' |
|
|
|
31✔ |
|
class RecordableHistogram {
|
|
|
#histogram = createHistogram()
|
75✔ |
|
|
75✔ |
|
constructor() { |
|
|
Object.keys(this.#histogram.toJSON()) |
75✔ |
|
.filter(prop => typeof prop !== 'object') |
|
|
.forEach(prop => Object.defineProperty(this, prop, {
|
|
|
enumerable: true, |
525✔ |
|
get() { return this.#histogram[prop] } |
|
|
})) |
75✔ |
|
} |
75✔ |
|
|
75✔ |
|
record(value) { |
|
|
return this.#histogram.record(value) |
5,792✔ |
|
} |
5,792✔ |
|
|
75✔ |
|
recordDelta() { |
75✔ |
NEW
|
return this.#histogram.recordDelta() |
× |
NEW
|
} |
× |
|
|
75✔ |
|
reset() { |
75✔ |
NEW
|
return this.#histogram.reset() |
× |
NEW
|
} |
× |
|
|
75✔ |
|
toJSON() { |
|
|
return this.#histogram.toJSON() |
5,792✔ |
|
} |
5,792✔ |
|
} |
75✔ |
|
|
31✔ |
|
export default RecordableHistogram |
31✔ |