test: add disposable histogram test · nodejs/node@5936cef

Original file line numberDiff line numberDiff line change

@@ -97,6 +97,17 @@ const { inspect } = require('util');

9797

}, 50);

9898

}

9999
100+

{

101+

// Tests that the ELD histogram is disposable

102+

let histogram;

103+

{

104+

using hi = monitorEventLoopDelay();

105+

histogram = hi;

106+

}

107+

// The histogram should already be disabled.

108+

strictEqual(histogram.disable(), false);

109+

}

110+
100111

{

101112

const h = createHistogram();

102113

ok(inspect(h, { depth: null }).startsWith('Histogram'));