Skip to content

Commit 99691cb

Browse files
committed
Fix lint
1 parent b3ec16b commit 99691cb

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

packages/instrumentation-runtime-node/src/metrics/heapSizeLimitCollector.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@ import { METRIC_V8JS_MEMORY_HEAP_MAX } from '../semconv';
2323

2424
export class HeapSizeLimitCollector extends BaseCollector {
2525
updateMetricInstruments(meter: Meter): void {
26-
const heapMax = meter.createObservableGauge(
27-
METRIC_V8JS_MEMORY_HEAP_MAX,
28-
{
29-
description:
30-
'Maximum heap size allowed by the V8 engine, as set by --max-old-space-size or V8 defaults.',
31-
unit: 'By',
32-
}
33-
);
26+
const heapMax = meter.createObservableGauge(METRIC_V8JS_MEMORY_HEAP_MAX, {
27+
description:
28+
'Maximum heap size allowed by the V8 engine, as set by --max-old-space-size or V8 defaults.',
29+
unit: 'By',
30+
});
3431

3532
meter.addBatchObservableCallback(
3633
observableResult => {

packages/instrumentation-runtime-node/test/heap_size_limit.test.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ describe('v8js.memory.heap.max', function () {
4141
instrumentation.setMeterProvider(meterProvider);
4242

4343
// act
44-
await new Promise(resolve =>
45-
setTimeout(resolve, MEASUREMENT_INTERVAL * 5)
46-
);
44+
await new Promise(resolve => setTimeout(resolve, MEASUREMENT_INTERVAL * 5));
4745
const { resourceMetrics, errors } = await metricReader.collect();
4846

4947
// assert
@@ -57,7 +55,11 @@ describe('v8js.memory.heap.max', function () {
5755
x => x.descriptor.name === METRIC_V8JS_MEMORY_HEAP_MAX
5856
);
5957

60-
assert.notEqual(metric, undefined, `${METRIC_V8JS_MEMORY_HEAP_MAX} not found`);
58+
assert.notEqual(
59+
metric,
60+
undefined,
61+
`${METRIC_V8JS_MEMORY_HEAP_MAX} not found`
62+
);
6163

6264
assert.strictEqual(
6365
metric!.dataPointType,
@@ -80,9 +82,7 @@ describe('v8js.memory.heap.max', function () {
8082
instrumentation.setMeterProvider(meterProvider);
8183

8284
// act
83-
await new Promise(resolve =>
84-
setTimeout(resolve, MEASUREMENT_INTERVAL * 5)
85-
);
85+
await new Promise(resolve => setTimeout(resolve, MEASUREMENT_INTERVAL * 5));
8686
const { resourceMetrics, errors } = await metricReader.collect();
8787

8888
// assert
@@ -92,10 +92,18 @@ describe('v8js.memory.heap.max', function () {
9292
x => x.descriptor.name === METRIC_V8JS_MEMORY_HEAP_MAX
9393
);
9494

95-
assert.notEqual(metric, undefined, `${METRIC_V8JS_MEMORY_HEAP_MAX} not found`);
95+
assert.notEqual(
96+
metric,
97+
undefined,
98+
`${METRIC_V8JS_MEMORY_HEAP_MAX} not found`
99+
);
96100

97101
if (metric!.dataPointType === DataPointType.GAUGE) {
98-
assert.strictEqual(metric!.dataPoints.length, 1, 'expected exactly one data point (global, not per-space)');
102+
assert.strictEqual(
103+
metric!.dataPoints.length,
104+
1,
105+
'expected exactly one data point (global, not per-space)'
106+
);
99107
const value = metric!.dataPoints[0].value as number;
100108
assert.ok(value > 0, `expected positive heap_size_limit, got ${value}`);
101109
}
@@ -109,9 +117,7 @@ describe('v8js.memory.heap.max', function () {
109117
instrumentation.setMeterProvider(meterProvider);
110118

111119
// act
112-
await new Promise(resolve =>
113-
setTimeout(resolve, MEASUREMENT_INTERVAL * 5)
114-
);
120+
await new Promise(resolve => setTimeout(resolve, MEASUREMENT_INTERVAL * 5));
115121
const { resourceMetrics, errors } = await metricReader.collect();
116122

117123
// assert

0 commit comments

Comments
 (0)