diff --git a/packages/beacon-node/src/util/workerEvents.ts b/packages/beacon-node/src/util/workerEvents.ts index 65a2f2dd3fbe..77ef84b45cc2 100644 --- a/packages/beacon-node/src/util/workerEvents.ts +++ b/packages/beacon-node/src/util/workerEvents.ts @@ -3,7 +3,7 @@ import {Metrics} from "../metrics/metrics.js"; import {NetworkCoreWorkerMetrics} from "../network/core/metrics.js"; import {StrictEventEmitterSingleArg} from "./strictEvents.js"; -const nanoToSecondConversion = 1e9; +const NANO_TO_SECOND_CONVERSION = 1e9; export type WorkerBridgeEvent = { type: string; @@ -42,7 +42,7 @@ export function wireEventsOnWorkerThread( ) { metrics?.networkWorkerWireEventsOnWorkerThreadLatencySec.observe( {eventName: data.event as string}, - Number(process.hrtime.bigint() - data.posted) / nanoToSecondConversion + Number(process.hrtime.bigint() - data.posted) / NANO_TO_SECOND_CONVERSION ); events.emit(data.event, data.data); } @@ -81,7 +81,7 @@ export function wireEventsOnMainThread( ) { metrics?.networkWorkerWireEventsOnMainThreadLatencySec.observe( {eventName: data.event as string}, - Number(process.hrtime.bigint() - data.posted) / nanoToSecondConversion + Number(process.hrtime.bigint() - data.posted) / NANO_TO_SECOND_CONVERSION ); events.emit(data.event, data.data); }