@code-pushup/utils
Advanced tools
| import { type Counter } from './process-id.js'; | ||
| import { type InvalidEntry, type RecoverResult, type WalFormat, type WalRecord, WriteAheadLogFile } from './wal.js'; | ||
| /** | ||
| * Counter for generating sequential shard IDs. | ||
| * Encapsulates the shard count increment logic. | ||
| */ | ||
| export declare const ShardedWalCounter: Counter; | ||
| /** | ||
| * Generates a unique readable instance ID. | ||
| * This ID uniquely identifies a shard/file per process/thread combination with a human-readable timestamp. | ||
| * Format: readable-timestamp.pid.threadId.counter | ||
| * Example: "20240101-120000-000.12345.1.1" | ||
| * | ||
| * @returns A unique ID string with readable timestamp, process ID, thread ID, and counter | ||
| */ | ||
| export declare function getShardId(): string; | ||
| /** | ||
| * @TODO remove in PR https://github.com/code-pushup/cli/pull/1231 in favour of class method getShardedFileName | ||
| * Generates a path to a shard file using human-readable IDs. | ||
| * Both groupId and shardId are already in readable date format. | ||
| * | ||
| * Example with groupId "20240101-120000-000" and shardId "20240101-120000-000.12345.1.1": | ||
| * Full path: /base/20240101-120000-000/trace.20240101-120000-000.12345.1.1.log | ||
| * | ||
| * @param opt.dir - The directory to store the shard file | ||
| * @param opt.format - The WalFormat to use for the shard file | ||
| * @param opt.groupId - The human-readable group ID (yyyymmdd-hhmmss-ms format) | ||
| * @param opt.shardId - The human-readable shard ID (readable-timestamp.pid.threadId.count format) | ||
| * @returns The path to the shard file | ||
| */ | ||
| export declare function getShardedPath<T extends object | string = object>(opt: { | ||
| dir?: string; | ||
| format: WalFormat<T>; | ||
| groupId: string; | ||
| shardId: string; | ||
| }): string; | ||
| /** | ||
| * Sharded Write-Ahead Log manager for coordinating multiple WAL shards. | ||
| * Handles distributed logging across multiple processes/files with atomic finalization. | ||
| */ | ||
| export declare class ShardedWal<T extends WalRecord = WalRecord> { | ||
| #private; | ||
| static instanceCount: number; | ||
| readonly groupId: string; | ||
| /** | ||
| * Initialize the given environment variable if not already set. | ||
| * This must be done as early as possible before any user code runs. | ||
| * Sets envVarName to the current instance ID if not already defined. | ||
| * | ||
| * @param envVarName - Environment variable name for storing coordinator ID | ||
| * @param instanceID - The instance ID to set as coordinator | ||
| */ | ||
| static setCoordinatorProcess(envVarName: string, instanceID: string): void; | ||
| /** | ||
| * Determines if this process is the leader WAL process. | ||
| * | ||
| * The leader is the process that first enabled profiling over the given env var. | ||
| * All descendant processes inherit the environment. | ||
| * | ||
| * @param envVarName - Environment variable name for storing coordinator ID | ||
| * @param instanceID - The instance ID to check | ||
| * @returns true if this is the leader WAL process, false otherwise | ||
| */ | ||
| static isCoordinatorProcess(envVarName: string, instanceID: string): boolean; | ||
| /** | ||
| * Create a sharded WAL manager. | ||
| * | ||
| * @param opt.dir - Base directory to store shard files (defaults to process.cwd()) | ||
| * @param opt.format - WAL format configuration | ||
| * @param opt.groupId - Group ID for sharding (defaults to generated group ID) | ||
| * @param opt.coordinatorIdEnvVar - Environment variable name for storing coordinator ID (defaults to CP_SHARDED_WAL_COORDINATOR_ID) | ||
| * @param opt.autoCoordinator - Whether to auto-set the coordinator ID on construction (defaults to true) | ||
| */ | ||
| constructor(opt: { | ||
| debug?: boolean; | ||
| dir?: string; | ||
| format: WalFormat<T>; | ||
| groupId?: string; | ||
| coordinatorIdEnvVar: string; | ||
| autoCoordinator?: boolean; | ||
| }); | ||
| /** | ||
| * Gets the unique instance ID for this ShardedWal. | ||
| * | ||
| * @returns The unique instance ID | ||
| */ | ||
| get id(): string; | ||
| /** | ||
| * Is this instance the coordinator? | ||
| * | ||
| * Coordinator status is determined from the coordinatorIdEnvVar environment variable. | ||
| * The coordinator handles finalization and cleanup of shard files. | ||
| * Checks dynamically to allow coordinator to be set after construction. | ||
| * | ||
| * @returns true if this instance is the coordinator, false otherwise | ||
| */ | ||
| isCoordinator(): boolean; | ||
| /** | ||
| * Asserts that the WAL is in 'active' state. | ||
| * Throws an error if the WAL has been finalized or cleaned. | ||
| * | ||
| * @throws Error if WAL is not in 'active' state | ||
| */ | ||
| private assertActive; | ||
| /** | ||
| * Gets the current lifecycle state of the WAL. | ||
| * | ||
| * @returns Current lifecycle state: 'active', 'finalized', or 'cleaned' | ||
| */ | ||
| getState(): 'active' | 'finalized' | 'cleaned'; | ||
| /** | ||
| * Checks if the WAL has been finalized. | ||
| * | ||
| * @returns true if WAL is in 'finalized' state, false otherwise | ||
| */ | ||
| isFinalized(): boolean; | ||
| /** | ||
| * Checks if the WAL has been cleaned. | ||
| * | ||
| * @returns true if WAL is in 'cleaned' state, false otherwise | ||
| */ | ||
| isCleaned(): boolean; | ||
| /** | ||
| * Generates a filename for a shard file using a shard ID. | ||
| * Both groupId and shardId are already in readable date format. | ||
| * | ||
| * Example with baseName "trace" and shardId "20240101-120000-000.12345.1.1": | ||
| * Filename: trace.20240101-120000-000.12345.1.1.log | ||
| * | ||
| * @param shardId - The human-readable shard ID (readable-timestamp.pid.threadId.count format) | ||
| * @returns The filename for the shard file | ||
| */ | ||
| getShardedFileName(shardId: string): string; | ||
| /** | ||
| * Generates a filename for the final merged output file. | ||
| * Uses the groupId as the identifier in the final filename. | ||
| * | ||
| * Example with baseName "trace" and groupId "20240101-120000-000": | ||
| * Filename: trace.20240101-120000-000.json | ||
| * | ||
| * Example with baseName "trace" and groupId "measureName": | ||
| * Filename: trace.measureName.json | ||
| * | ||
| * @returns The filename for the final merged output file | ||
| */ | ||
| getFinalFilePath(): string; | ||
| shard(): WriteAheadLogFile<T>; | ||
| /** Get all shard file paths matching this WAL's base name */ | ||
| private shardFiles; | ||
| /** Get shard file paths created by this instance */ | ||
| private getCreatedShardFiles; | ||
| /** | ||
| * Finalize all shards by merging them into a single output file. | ||
| * Recovers all records from all shards, validates no errors, and writes merged result. | ||
| * Idempotent: returns early if already finalized or cleaned. | ||
| * @throws Error if custom finalizer method throws | ||
| */ | ||
| finalize(opt?: Record<string, unknown>): void; | ||
| /** | ||
| * Cleanup shard files by removing them from disk. | ||
| * Coordinator-only: throws error if not coordinator to prevent race conditions. | ||
| * Idempotent: returns early if already cleaned. | ||
| */ | ||
| cleanup(): void; | ||
| get stats(): { | ||
| lastRecovery: { | ||
| file: string; | ||
| result: RecoverResult<T | InvalidEntry<string>>; | ||
| }[]; | ||
| state: "active" | "finalized" | "cleaned"; | ||
| groupId: string; | ||
| shardCount: number; | ||
| isCoordinator: boolean; | ||
| isFinalized: boolean; | ||
| isCleaned: boolean; | ||
| finalFilePath: string; | ||
| shardFileCount: number; | ||
| shardFiles: string[]; | ||
| }; | ||
| finalizeIfCoordinator(opt?: Record<string, unknown>): void; | ||
| /** | ||
| * Cleanup shard files if this instance is the coordinator. | ||
| * Safe to call from any process - only coordinator will execute cleanup. | ||
| */ | ||
| cleanupIfCoordinator(): void; | ||
| } |
| var _a; | ||
| import * as fs from 'node:fs'; | ||
| import path from 'node:path'; | ||
| import process from 'node:process'; | ||
| import { threadId } from 'node:worker_threads'; | ||
| import { extendError } from './errors.js'; | ||
| import { getUniqueInstanceId, getUniqueTimeId, } from './process-id.js'; | ||
| import { WriteAheadLogFile, ensureDirectoryExistsSync, filterValidRecords, } from './wal.js'; | ||
| /** | ||
| * Validates that a groupId is safe to use as a single path segment. | ||
| * Rejects path traversal attempts and path separators to prevent writing outside intended directory. | ||
| * | ||
| * @param groupId - The groupId to validate | ||
| * @throws Error if groupId contains unsafe characters or path traversal sequences | ||
| */ | ||
| function validateGroupId(groupId) { | ||
| // Reject empty or whitespace-only groupIds | ||
| if (!groupId || groupId.trim().length === 0) { | ||
| throw new Error('groupId cannot be empty or whitespace-only'); | ||
| } | ||
| // Reject path separators (both forward and backward slashes) | ||
| if (groupId.includes('/') || groupId.includes('\\')) { | ||
| throw new Error('groupId cannot contain path separators'); | ||
| } | ||
| // Reject relative path components | ||
| if (groupId === '..' || groupId === '.') { | ||
| throw new Error('groupId cannot be "." or ".."'); | ||
| } | ||
| // Reject null bytes which can be used to bypass validation | ||
| if (groupId.includes('\0')) { | ||
| throw new Error('groupId cannot contain null bytes'); | ||
| } | ||
| // Validate that the resolved path stays within the intended directory | ||
| // This catches cases where the path library normalizes to a parent directory | ||
| const normalized = path.normalize(groupId); | ||
| if (normalized !== groupId || normalized.startsWith('..')) { | ||
| throw new Error(`groupId normalization resulted in unsafe path: ${normalized}`); | ||
| } | ||
| } | ||
| // eslint-disable-next-line functional/no-let | ||
| let shardCount = 0; | ||
| /** | ||
| * Counter for generating sequential shard IDs. | ||
| * Encapsulates the shard count increment logic. | ||
| */ | ||
| export const ShardedWalCounter = { | ||
| next() { | ||
| return ++shardCount; | ||
| }, | ||
| }; | ||
| /** | ||
| * Generates a unique readable instance ID. | ||
| * This ID uniquely identifies a shard/file per process/thread combination with a human-readable timestamp. | ||
| * Format: readable-timestamp.pid.threadId.counter | ||
| * Example: "20240101-120000-000.12345.1.1" | ||
| * | ||
| * @returns A unique ID string with readable timestamp, process ID, thread ID, and counter | ||
| */ | ||
| export function getShardId() { | ||
| return `${getUniqueTimeId()}.${process.pid}.${threadId}.${ShardedWalCounter.next()}`; | ||
| } | ||
| /** | ||
| * @TODO remove in PR https://github.com/code-pushup/cli/pull/1231 in favour of class method getShardedFileName | ||
| * Generates a path to a shard file using human-readable IDs. | ||
| * Both groupId and shardId are already in readable date format. | ||
| * | ||
| * Example with groupId "20240101-120000-000" and shardId "20240101-120000-000.12345.1.1": | ||
| * Full path: /base/20240101-120000-000/trace.20240101-120000-000.12345.1.1.log | ||
| * | ||
| * @param opt.dir - The directory to store the shard file | ||
| * @param opt.format - The WalFormat to use for the shard file | ||
| * @param opt.groupId - The human-readable group ID (yyyymmdd-hhmmss-ms format) | ||
| * @param opt.shardId - The human-readable shard ID (readable-timestamp.pid.threadId.count format) | ||
| * @returns The path to the shard file | ||
| */ | ||
| export function getShardedPath(opt) { | ||
| const { dir = '', format, groupId, shardId } = opt; | ||
| const { baseName, walExtension } = format; | ||
| return path.join(dir, groupId, `${baseName}.${shardId}${walExtension}`); | ||
| } | ||
| /** | ||
| * Sharded Write-Ahead Log manager for coordinating multiple WAL shards. | ||
| * Handles distributed logging across multiple processes/files with atomic finalization. | ||
| */ | ||
| export class ShardedWal { | ||
| static instanceCount = 0; | ||
| #id = getUniqueInstanceId({ | ||
| next() { | ||
| return ++_a.instanceCount; | ||
| }, | ||
| }); | ||
| groupId; | ||
| #debug = false; | ||
| #format; | ||
| #dir = process.cwd(); | ||
| #coordinatorIdEnvVar; | ||
| #state = 'active'; | ||
| #lastRecovery = []; | ||
| #createdShardFiles = []; | ||
| /** | ||
| * Initialize the given environment variable if not already set. | ||
| * This must be done as early as possible before any user code runs. | ||
| * Sets envVarName to the current instance ID if not already defined. | ||
| * | ||
| * @param envVarName - Environment variable name for storing coordinator ID | ||
| * @param instanceID - The instance ID to set as coordinator | ||
| */ | ||
| static setCoordinatorProcess(envVarName, instanceID) { | ||
| if (!process.env[envVarName]) { | ||
| process.env[envVarName] = instanceID; | ||
| } | ||
| } | ||
| /** | ||
| * Determines if this process is the leader WAL process. | ||
| * | ||
| * The leader is the process that first enabled profiling over the given env var. | ||
| * All descendant processes inherit the environment. | ||
| * | ||
| * @param envVarName - Environment variable name for storing coordinator ID | ||
| * @param instanceID - The instance ID to check | ||
| * @returns true if this is the leader WAL process, false otherwise | ||
| */ | ||
| static isCoordinatorProcess(envVarName, instanceID) { | ||
| return process.env[envVarName] === instanceID; | ||
| } | ||
| /** | ||
| * Create a sharded WAL manager. | ||
| * | ||
| * @param opt.dir - Base directory to store shard files (defaults to process.cwd()) | ||
| * @param opt.format - WAL format configuration | ||
| * @param opt.groupId - Group ID for sharding (defaults to generated group ID) | ||
| * @param opt.coordinatorIdEnvVar - Environment variable name for storing coordinator ID (defaults to CP_SHARDED_WAL_COORDINATOR_ID) | ||
| * @param opt.autoCoordinator - Whether to auto-set the coordinator ID on construction (defaults to true) | ||
| */ | ||
| constructor(opt) { | ||
| const { dir, format, debug, groupId, coordinatorIdEnvVar, autoCoordinator = true, } = opt; | ||
| if (debug != null) { | ||
| this.#debug = debug; | ||
| } | ||
| // Determine groupId: use provided, then env var, or generate | ||
| const resolvedGroupId = groupId == null ? getUniqueTimeId() : groupId; | ||
| // Validate groupId for path safety before using it | ||
| validateGroupId(resolvedGroupId); | ||
| this.groupId = resolvedGroupId; | ||
| if (dir) { | ||
| this.#dir = dir; | ||
| } | ||
| this.#format = format; | ||
| this.#coordinatorIdEnvVar = coordinatorIdEnvVar; | ||
| if (autoCoordinator) { | ||
| _a.setCoordinatorProcess(this.#coordinatorIdEnvVar, this.#id); | ||
| } | ||
| } | ||
| /** | ||
| * Gets the unique instance ID for this ShardedWal. | ||
| * | ||
| * @returns The unique instance ID | ||
| */ | ||
| get id() { | ||
| return this.#id; | ||
| } | ||
| /** | ||
| * Is this instance the coordinator? | ||
| * | ||
| * Coordinator status is determined from the coordinatorIdEnvVar environment variable. | ||
| * The coordinator handles finalization and cleanup of shard files. | ||
| * Checks dynamically to allow coordinator to be set after construction. | ||
| * | ||
| * @returns true if this instance is the coordinator, false otherwise | ||
| */ | ||
| isCoordinator() { | ||
| return _a.isCoordinatorProcess(this.#coordinatorIdEnvVar, this.#id); | ||
| } | ||
| /** | ||
| * Asserts that the WAL is in 'active' state. | ||
| * Throws an error if the WAL has been finalized or cleaned. | ||
| * | ||
| * @throws Error if WAL is not in 'active' state | ||
| */ | ||
| assertActive() { | ||
| if (this.#state !== 'active') { | ||
| throw new Error(`WAL is ${this.#state}, cannot modify`); | ||
| } | ||
| } | ||
| /** | ||
| * Gets the current lifecycle state of the WAL. | ||
| * | ||
| * @returns Current lifecycle state: 'active', 'finalized', or 'cleaned' | ||
| */ | ||
| getState() { | ||
| return this.#state; | ||
| } | ||
| /** | ||
| * Checks if the WAL has been finalized. | ||
| * | ||
| * @returns true if WAL is in 'finalized' state, false otherwise | ||
| */ | ||
| isFinalized() { | ||
| return this.#state === 'finalized'; | ||
| } | ||
| /** | ||
| * Checks if the WAL has been cleaned. | ||
| * | ||
| * @returns true if WAL is in 'cleaned' state, false otherwise | ||
| */ | ||
| isCleaned() { | ||
| return this.#state === 'cleaned'; | ||
| } | ||
| /** | ||
| * Generates a filename for a shard file using a shard ID. | ||
| * Both groupId and shardId are already in readable date format. | ||
| * | ||
| * Example with baseName "trace" and shardId "20240101-120000-000.12345.1.1": | ||
| * Filename: trace.20240101-120000-000.12345.1.1.log | ||
| * | ||
| * @param shardId - The human-readable shard ID (readable-timestamp.pid.threadId.count format) | ||
| * @returns The filename for the shard file | ||
| */ | ||
| getShardedFileName(shardId) { | ||
| const { baseName, walExtension } = this.#format; | ||
| return `${baseName}.${shardId}${walExtension}`; | ||
| } | ||
| /** | ||
| * Generates a filename for the final merged output file. | ||
| * Uses the groupId as the identifier in the final filename. | ||
| * | ||
| * Example with baseName "trace" and groupId "20240101-120000-000": | ||
| * Filename: trace.20240101-120000-000.json | ||
| * | ||
| * Example with baseName "trace" and groupId "measureName": | ||
| * Filename: trace.measureName.json | ||
| * | ||
| * @returns The filename for the final merged output file | ||
| */ | ||
| getFinalFilePath() { | ||
| const groupIdDir = path.join(this.#dir, this.groupId); | ||
| const { baseName, finalExtension } = this.#format; | ||
| return path.join(groupIdDir, `${baseName}.${this.groupId}${finalExtension}`); | ||
| } | ||
| shard() { | ||
| this.assertActive(); | ||
| const filePath = path.join(this.#dir, this.groupId, this.getShardedFileName(getShardId())); | ||
| this.#createdShardFiles.push(filePath); | ||
| return new WriteAheadLogFile({ | ||
| file: filePath, | ||
| codec: this.#format.codec, | ||
| }); | ||
| } | ||
| /** Get all shard file paths matching this WAL's base name */ | ||
| shardFiles() { | ||
| if (!fs.existsSync(this.#dir)) { | ||
| return []; | ||
| } | ||
| const groupDir = path.join(this.#dir, this.groupId); | ||
| if (!fs.existsSync(groupDir)) { | ||
| return []; | ||
| } | ||
| return fs | ||
| .readdirSync(groupDir) | ||
| .filter(entry => entry.endsWith(this.#format.walExtension)) | ||
| .filter(entry => entry.startsWith(`${this.#format.baseName}`)) | ||
| .map(entry => path.join(groupDir, entry)); | ||
| } | ||
| /** Get shard file paths created by this instance */ | ||
| getCreatedShardFiles() { | ||
| return this.#createdShardFiles.filter(f => fs.existsSync(f)); | ||
| } | ||
| /** | ||
| * Finalize all shards by merging them into a single output file. | ||
| * Recovers all records from all shards, validates no errors, and writes merged result. | ||
| * Idempotent: returns early if already finalized or cleaned. | ||
| * @throws Error if custom finalizer method throws | ||
| */ | ||
| finalize(opt) { | ||
| if (this.#state !== 'active') { | ||
| return; | ||
| } | ||
| // Ensure base directory exists before calling shardFiles() | ||
| ensureDirectoryExistsSync(this.#dir); | ||
| const lastRecovery = this.shardFiles().map(f => ({ | ||
| file: f, | ||
| result: new WriteAheadLogFile({ | ||
| file: f, | ||
| codec: this.#format.codec, | ||
| }).recover(), | ||
| })); | ||
| const records = lastRecovery.flatMap(({ result }) => result.records); | ||
| if (this.#debug) { | ||
| this.#lastRecovery = lastRecovery; | ||
| } | ||
| ensureDirectoryExistsSync(path.dirname(this.getFinalFilePath())); | ||
| try { | ||
| fs.writeFileSync(this.getFinalFilePath(), this.#format.finalizer(filterValidRecords(records), opt)); | ||
| } | ||
| catch (error) { | ||
| throw extendError(error, 'Could not finalize sharded wal. Finalizer method in format throws.', { appendOriginalMessage: true }); | ||
| } | ||
| this.#state = 'finalized'; | ||
| } | ||
| /** | ||
| * Cleanup shard files by removing them from disk. | ||
| * Coordinator-only: throws error if not coordinator to prevent race conditions. | ||
| * Idempotent: returns early if already cleaned. | ||
| */ | ||
| cleanup() { | ||
| if (!this.isCoordinator()) { | ||
| throw new Error('cleanup() can only be called by coordinator'); | ||
| } | ||
| if (this.#state === 'cleaned') { | ||
| return; | ||
| } | ||
| this.shardFiles() | ||
| .filter(f => fs.existsSync(f)) | ||
| .forEach(f => { | ||
| fs.unlinkSync(f); | ||
| }); | ||
| this.#state = 'cleaned'; | ||
| } | ||
| get stats() { | ||
| // When finalized, count all shard files from filesystem (for multi-process scenarios) | ||
| // Otherwise, count only files created by this instance | ||
| const shardFilesList = this.#state === 'finalized' || this.#state === 'cleaned' | ||
| ? this.shardFiles() | ||
| : this.getCreatedShardFiles(); | ||
| return { | ||
| lastRecovery: this.#lastRecovery, | ||
| state: this.#state, | ||
| groupId: this.groupId, | ||
| shardCount: shardFilesList.length, | ||
| isCoordinator: this.isCoordinator(), | ||
| isFinalized: this.isFinalized(), | ||
| isCleaned: this.isCleaned(), | ||
| finalFilePath: this.getFinalFilePath(), | ||
| shardFileCount: shardFilesList.length, | ||
| shardFiles: shardFilesList, | ||
| }; | ||
| } | ||
| finalizeIfCoordinator(opt) { | ||
| if (this.isCoordinator()) { | ||
| this.finalize(opt); | ||
| } | ||
| } | ||
| /** | ||
| * Cleanup shard files if this instance is the coordinator. | ||
| * Safe to call from any process - only coordinator will execute cleanup. | ||
| */ | ||
| cleanupIfCoordinator() { | ||
| if (this.isCoordinator()) { | ||
| this.cleanup(); | ||
| } | ||
| } | ||
| } | ||
| _a = ShardedWal; | ||
| //# sourceMappingURL=wal-sharded.js.map |
| {"version":3,"file":"wal-sharded.js","sourceRoot":"","sources":["../../../src/lib/wal-sharded.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAEL,mBAAmB,EACnB,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAKL,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAElB;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,OAAe;IACtC,2CAA2C;IAC3C,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,6DAA6D;IAC7D,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,CAA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,CAAC,MAAM;YACjC,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE;YACnC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;YAC/B,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE;YAC3B,aAAa,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACtC,cAAc,EAAE,cAAc,CAAC,MAAM;YACrC,UAAU,EAAE,cAAc;SAC3B,CAAC;IACJ,CAAC;IAED,qBAAqB,CAAC,GAA6B;QACjD,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;YACzB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,oBAAoB;QAClB,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;YACzB,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;IACH,CAAC"} |
+2
-2
| { | ||
| "name": "@code-pushup/utils", | ||
| "version": "0.115.0", | ||
| "version": "0.116.0", | ||
| "description": "Low-level utilities (helper functions, etc.) used by Code PushUp CLI", | ||
@@ -30,3 +30,3 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@code-pushup/models": "0.115.0", | ||
| "@code-pushup/models": "0.116.0", | ||
| "ansis": "^3.3.0", | ||
@@ -33,0 +33,0 @@ "build-md": "^0.4.2", |
| import { writeFile } from 'node:fs/promises'; | ||
| import path from 'node:path'; | ||
| import { threadId } from 'node:worker_threads'; | ||
| import { ensureDirectoryExists, pluginWorkDir } from './file-system.js'; | ||
| import { getUniqueProcessThreadId } from './process-id.js'; | ||
| /** | ||
@@ -12,5 +12,3 @@ * Function to create timestamp nested plugin runner files for config and output. | ||
| export async function createRunnerFiles(pluginSlug, configJSON) { | ||
| // Use timestamp + process ID + threadId | ||
| // This prevents race conditions when running the same plugin for multiple projects in parallel | ||
| const uniqueId = `${(performance.timeOrigin + performance.now()) * 10}-${process.pid}-${threadId}`; | ||
| const uniqueId = getUniqueProcessThreadId(); | ||
| const runnerWorkDir = path.join(pluginWorkDir(pluginSlug), uniqueId); | ||
@@ -17,0 +15,0 @@ const runnerConfigPath = path.join(runnerWorkDir, 'plugin-config.json'); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"create-runner-files.js","sourceRoot":"","sources":["../../../src/lib/create-runner-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,UAAkB,EAClB,UAAkB;IAElB,wCAAwC;IACxC,+FAA+F;IAC/F,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,IAAI,OAAO,CAAC,GAAG,IAAI,QAAQ,EAAE,CAAC;IACnG,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAC;IACrE,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;IACxE,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;IAExE,MAAM,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC5D,MAAM,SAAS,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;IAE9C,OAAO;QACL,gBAAgB;QAChB,gBAAgB;KACjB,CAAC;AACJ,CAAC"} | ||
| {"version":3,"file":"create-runner-files.js","sourceRoot":"","sources":["../../../src/lib/create-runner-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,UAAkB,EAClB,UAAkB;IAElB,MAAM,QAAQ,GAAG,wBAAwB,EAAE,CAAC;IAC5C,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAC;IACrE,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;IACxE,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;IAExE,MAAM,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC5D,MAAM,SAAS,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;IAE9C,OAAO;QACL,gBAAgB;QAChB,gBAAgB;KACjB,CAAC;AACJ,CAAC"} |
+11
-0
| export declare function stringifyError(error: unknown, format?: { | ||
| oneline: boolean; | ||
| }): string; | ||
| /** | ||
| * Extends an error with a new message and keeps the original as the cause. | ||
| * This helps to keep the stacktrace intact and enables better debugging. | ||
| * @param error - The error to extend | ||
| * @param message - The new message to add to the error | ||
| * @param appendOriginalMessage - Whether to add the original error message after new message | ||
| * @returns A new error with the extended message and the original as cause | ||
| */ | ||
| export declare function extendError(error: unknown, message: string, { appendOriginalMessage }?: { | ||
| appendOriginalMessage?: boolean | undefined; | ||
| }): Error; |
+14
-0
@@ -26,2 +26,16 @@ import { ZodError, z } from 'zod'; | ||
| } | ||
| /** | ||
| * Extends an error with a new message and keeps the original as the cause. | ||
| * This helps to keep the stacktrace intact and enables better debugging. | ||
| * @param error - The error to extend | ||
| * @param message - The new message to add to the error | ||
| * @param appendOriginalMessage - Whether to add the original error message after new message | ||
| * @returns A new error with the extended message and the original as cause | ||
| */ | ||
| export function extendError(error, message, { appendOriginalMessage = false } = {}) { | ||
| const errorMessage = appendOriginalMessage | ||
| ? `${message}\n${stringifyError(error)}` | ||
| : message; | ||
| return new Error(errorMessage, { cause: error }); | ||
| } | ||
| //# sourceMappingURL=errors.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,MAAM,UAAU,cAAc,CAC5B,KAAc,EACd,MAA6B;IAE7B,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE,CAChC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEvD,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;QAC9B,MAAM,cAAc,GAAG,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;gBACpB,OAAO,GAAG,KAAK,CAAC,IAAI,KAAK,gBAAgB,GAAG,CAAC;YAC/C,CAAC;YACD,OAAO,GAAG,KAAK,CAAC,IAAI,MAAM,cAAc,IAAI,CAAC;QAC/C,CAAC;QACD,OAAO,GAAG,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;IAC5C,CAAC;IAED,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,IA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AI,KAAK,cAAc,EAAE,CAAC;IAC5C,CAAC;IAED,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACnE,OAAO,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACzB,KAAc,EACd,OAAe,EACf,EAAE,qBAAqB,GAAG,KAAK,EAAE,GAAG,EAAE;IAEtC,MAAM,YAAY,GAAG,qBAAqB;QACxC,CAAC,CAAC,GAAG,OAAO,KAAK,cAAc,CAAC,KAAK,CAAC,EAAE;QACxC,CAAC,CAAC,OAAO,CAAC;IACZ,OAAO,IAAI,KAAK,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AACnD,CAAC"} |
@@ -30,1 +30,6 @@ /** | ||
| export declare const PROFILER_PERSIST_BASENAME = "trace"; | ||
| /** | ||
| * Name for current measure. | ||
| * Used as the name for the sharded folder. | ||
| */ | ||
| export declare const PROFILER_MEASURE_NAME_ENV_VAR = "CP_PROFILER_MEASURE_NAME"; |
@@ -30,2 +30,7 @@ /** | ||
| export const PROFILER_PERSIST_BASENAME = 'trace'; | ||
| /** | ||
| * Name for current measure. | ||
| * Used as the name for the sharded folder. | ||
| */ | ||
| export const PROFILER_MEASURE_NAME_ENV_VAR = 'CP_PROFILER_MEASURE_NAME'; | ||
| //# sourceMappingURL=constants.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/lib/profiler/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAC7C,+BAA+B,CAAC;AAElC;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAO,CAAC"} | ||
| {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/lib/profiler/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAC7C,+BAA+B,CAAC;AAElC;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAO,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,0BAA0B,CAAC"} |
| import { type PerformanceObserverOptions } from '../performance-observer.js'; | ||
| import type { ActionTrackEntryPayload } from '../user-timing-extensibility-api.type.js'; | ||
| import { type WalRecord } from '../wal.js'; | ||
| import { Profiler, type ProfilerOptions } from './profiler.js'; | ||
@@ -43,3 +44,3 @@ /** | ||
| */ | ||
| export declare class NodejsProfiler<DomainEvents extends string | object, Tracks extends Record<string, ActionTrackEntryPayload> = Record<string, ActionTrackEntryPayload>> extends Profiler<Tracks> { | ||
| export declare class NodejsProfiler<DomainEvents extends WalRecord, Tracks extends Record<string, ActionTrackEntryPayload> = Record<string, ActionTrackEntryPayload>> extends Profiler<Tracks> { | ||
| #private; | ||
@@ -46,0 +47,0 @@ /** |
@@ -8,3 +8,4 @@ import path from 'node:path'; | ||
| import { errorToMarkerPayload } from '../user-timing-extensibility-api-utils.js'; | ||
| import { WriteAheadLogFile, getShardedPath, } from '../wal.js'; | ||
| import { getShardedPath } from '../wal-sharded.js'; | ||
| import { WriteAheadLogFile, } from '../wal.js'; | ||
| import { PROFILER_DEBUG_ENV_VAR, PROFILER_ENABLED_ENV_VAR, } from './constants.js'; | ||
@@ -55,3 +56,5 @@ import { Profiler } from './profiler.js'; | ||
| file: filename ?? | ||
| path.join(process.cwd(), getShardedPath({ | ||
| path.join(process.cwd(), | ||
| // @TODO remove in PR https://github.com/code-pushup/cli/pull/1231 in favour of class method getShardedFileName | ||
| getShardedPath({ | ||
| dir: 'tmp/profiles', | ||
@@ -58,0 +61,0 @@ groupId: getUniqueTimeId(), |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"profiler-node.js","sourceRoot":"","sources":["../../../../src/lib/profiler/profiler-node.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAEL,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,mBAAmB,EACnB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAKjF,OAAO,EAEL,iBAAiB,EACjB,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAwB,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAq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AAI,CAAC,MAAM;YAClB,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;SAChC,CAAC;IACJ,CAAC;IAED,iDAAiD;IACjD,KAAK;QACH,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,CAAC,kBAAkB;QAC5B,CAAC;QACD,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;IAED,2DAA2D;IAC3D,IAAI,QAAQ;QACV,OAAQ,IAAI,CAAC,KAAyC,CAAC,OAAO,EAAE,CAAC;IACnE,CAAC;CACF"} |
+8
-82
@@ -81,3 +81,3 @@ /** | ||
| */ | ||
| export declare class WriteAheadLogFile<T> implements AppendableSink<T> { | ||
| export declare class WriteAheadLogFile<T extends WalRecord = WalRecord> implements AppendableSink<T> { | ||
| #private; | ||
@@ -126,2 +126,3 @@ /** | ||
| } | ||
| export type WalRecord = object | string; | ||
| /** | ||
@@ -131,3 +132,3 @@ * Format descriptor that binds codec and file extension together. | ||
| */ | ||
| export type WalFormat<T extends object | string> = { | ||
| export type WalFormat<T extends WalRecord = WalRecord> = { | ||
| /** Base name for the WAL (e.g., "trace") */ | ||
@@ -158,83 +159,8 @@ baseName: string; | ||
| */ | ||
| export declare function parseWalFormat<T extends object | string = object>(format: Partial<WalFormat<T>>): WalFormat<T>; | ||
| export declare function parseWalFormat<T extends WalRecord = WalRecord>(format: Partial<WalFormat<T>>): WalFormat<T>; | ||
| /** | ||
| * Determines if this process is the leader WAL process using the origin PID heuristic. | ||
| * | ||
| * The leader is the process that first enabled profiling (the one that set CP_PROFILER_ORIGIN_PID). | ||
| * All descendant processes inherit the environment but have different PIDs. | ||
| * | ||
| * @returns true if this is the leader WAL process, false otherwise | ||
| * NOTE: this helper is only used within the scope of wal and sharded wal logic. The rest of the repo avoids sync methods so it is not reusable. | ||
| * Ensures a directory exists, creating it recursively if necessary using sync methods. | ||
| * @param dirPath - The directory path to ensure exists | ||
| */ | ||
| export declare function isCoordinatorProcess(envVarName: string, profilerID: string): boolean; | ||
| /** | ||
| * Initialize the origin PID environment variable if not already set. | ||
| * This must be done as early as possible before any user code runs. | ||
| * Sets envVarName to the current process ID if not already defined. | ||
| */ | ||
| export declare function setCoordinatorProcess(envVarName: string, profilerID: string): void; | ||
| /** | ||
| * Generates a path to a shard file using human-readable IDs. | ||
| * Both groupId and shardId are already in readable date format. | ||
| * | ||
| * Example with groupId "20240101-120000-000" and shardId "20240101-120000-000.12345.1.1": | ||
| * Full path: /base/20240101-120000-000/trace.20240101-120000-000.12345.1.1.log | ||
| * | ||
| * @param opt.dir - The directory to store the shard file | ||
| * @param opt.format - The WalFormat to use for the shard file | ||
| * @param opt.groupId - The human-readable group ID (yyyymmdd-hhmmss-ms format) | ||
| * @param opt.shardId - The human-readable shard ID (readable-timestamp.pid.threadId.count format) | ||
| * @returns The path to the shard file | ||
| */ | ||
| export declare function getShardedPath<T extends object | string = object>(opt: { | ||
| dir?: string; | ||
| format: WalFormat<T>; | ||
| groupId: string; | ||
| shardId: string; | ||
| }): string; | ||
| export declare function getShardedFinalPath<T extends object | string = object>(opt: { | ||
| dir?: string; | ||
| format: WalFormat<T>; | ||
| groupId: string; | ||
| }): string; | ||
| /** | ||
| * Sharded Write-Ahead Log manager for coordinating multiple WAL shards. | ||
| * Handles distributed logging across multiple processes/files with atomic finalization. | ||
| */ | ||
| export declare class ShardedWal<T extends object | string = object> { | ||
| #private; | ||
| static instanceCount: number; | ||
| readonly groupId: string; | ||
| /** | ||
| * Create a sharded WAL manager. | ||
| * | ||
| * @param opt.dir - Base directory to store shard files (defaults to process.cwd()) | ||
| * @param opt.format - WAL format configuration | ||
| * @param opt.groupId - Group ID for sharding (defaults to generated group ID) | ||
| * @param opt.coordinatorIdEnvVar - Environment variable name for storing coordinator ID (defaults to CP_SHARDED_WAL_COORDINATOR_ID) | ||
| */ | ||
| constructor(opt: { | ||
| dir?: string; | ||
| format: Partial<WalFormat<T>>; | ||
| groupId?: string; | ||
| coordinatorIdEnvVar: string; | ||
| }); | ||
| /** | ||
| * Is this instance the coordinator? | ||
| * | ||
| * Coordinator status is determined from the coordinatorIdEnvVar environment variable. | ||
| * The coordinator handles finalization and cleanup of shard files. | ||
| * | ||
| * @returns true if this instance is the coordinator, false otherwise | ||
| */ | ||
| isCoordinator(): boolean; | ||
| shard(shardId?: string): WriteAheadLogFile<T>; | ||
| /** Get all shard file paths matching this WAL's base name */ | ||
| private shardFiles; | ||
| /** | ||
| * Finalize all shards by merging them into a single output file. | ||
| * Recovers all records from all shards, validates no errors, and writes merged result. | ||
| * @throws Error if any shard contains decode errors | ||
| */ | ||
| finalize(opt?: Record<string, unknown>): void; | ||
| cleanup(): void; | ||
| } | ||
| export declare function ensureDirectoryExistsSync(dirPath: string): void; |
+4
-184
@@ -1,7 +0,3 @@ | ||
| /* eslint-disable max-lines */ | ||
| import * as fs from 'node:fs'; | ||
| import path from 'node:path'; | ||
| import process from 'node:process'; | ||
| import { threadId } from 'node:worker_threads'; | ||
| import { getUniqueInstanceId, getUniqueTimeId, } from './process-id.js'; | ||
| export const createTolerantCodec = (codec) => { | ||
@@ -147,4 +143,4 @@ const { encode, decode } = codec; | ||
| const recordsToWrite = hasInvalidEntries | ||
| ? r.records | ||
| : filterValidRecords(r.records); | ||
| ? filterValidRecords(r.records) | ||
| : r.records; | ||
| ensureDirectoryExistsSync(path.dirname(out)); | ||
@@ -214,43 +210,7 @@ fs.writeFileSync(out, `${recordsToWrite.map(this.#encode).join('\n')}\n`); | ||
| /** | ||
| * Determines if this process is the leader WAL process using the origin PID heuristic. | ||
| * | ||
| * The leader is the process that first enabled profiling (the one that set CP_PROFILER_ORIGIN_PID). | ||
| * All descendant processes inherit the environment but have different PIDs. | ||
| * | ||
| * @returns true if this is the leader WAL process, false otherwise | ||
| */ | ||
| export function isCoordinatorProcess(envVarName, profilerID) { | ||
| return process.env[envVarName] === profilerID; | ||
| } | ||
| /** | ||
| * Initialize the origin PID environment variable if not already set. | ||
| * This must be done as early as possible before any user code runs. | ||
| * Sets envVarName to the current process ID if not already defined. | ||
| */ | ||
| export function setCoordinatorProcess(envVarName, profilerID) { | ||
| if (!process.env[envVarName]) { | ||
| // eslint-disable-next-line functional/immutable-data | ||
| process.env[envVarName] = profilerID; | ||
| } | ||
| } | ||
| /** | ||
| * Simple counter implementation for generating sequential IDs. | ||
| */ | ||
| const shardCounter = (() => { | ||
| // eslint-disable-next-line functional/no-let | ||
| let count = 0; | ||
| return { next: () => ++count }; | ||
| })(); | ||
| /** | ||
| * Generates a unique sharded WAL ID based on performance time origin, process ID, thread ID, and instance count. | ||
| */ | ||
| function getShardedWalId() { | ||
| // eslint-disable-next-line functional/immutable-data | ||
| return `${Math.round(performance.timeOrigin)}.${process.pid}.${threadId}.${++ShardedWal.instanceCount}`; | ||
| } | ||
| /** | ||
| * NOTE: this helper is only used within the scope of wal and sharded wal logic. The rest of the repo avoids sync methods so it is not reusable. | ||
| * Ensures a directory exists, creating it recursively if necessary using sync methods. | ||
| * @param dirPath - The directory path to ensure exists | ||
| */ | ||
| function ensureDirectoryExistsSync(dirPath) { | ||
| export function ensureDirectoryExistsSync(dirPath) { | ||
| if (!fs.existsSync(dirPath)) { | ||
@@ -260,142 +220,2 @@ fs.mkdirSync(dirPath, { recursive: true }); | ||
| } | ||
| /** | ||
| * Generates a path to a shard file using human-readable IDs. | ||
| * Both groupId and shardId are already in readable date format. | ||
| * | ||
| * Example with groupId "20240101-120000-000" and shardId "20240101-120000-000.12345.1.1": | ||
| * Full path: /base/20240101-120000-000/trace.20240101-120000-000.12345.1.1.log | ||
| * | ||
| * @param opt.dir - The directory to store the shard file | ||
| * @param opt.format - The WalFormat to use for the shard file | ||
| * @param opt.groupId - The human-readable group ID (yyyymmdd-hhmmss-ms format) | ||
| * @param opt.shardId - The human-readable shard ID (readable-timestamp.pid.threadId.count format) | ||
| * @returns The path to the shard file | ||
| */ | ||
| export function getShardedPath(opt) { | ||
| const { dir = '', format, groupId, shardId } = opt; | ||
| const { baseName, walExtension } = format; | ||
| return path.join(dir, groupId, `${baseName}.${shardId}${walExtension}`); | ||
| } | ||
| export function getShardedFinalPath(opt) { | ||
| const { dir = '', format, groupId } = opt; | ||
| const { baseName, finalExtension } = format; | ||
| return path.join(dir, groupId, `${baseName}.${groupId}${finalExtension}`); | ||
| } | ||
| /** | ||
| * Sharded Write-Ahead Log manager for coordinating multiple WAL shards. | ||
| * Handles distributed logging across multiple processes/files with atomic finalization. | ||
| */ | ||
| export class ShardedWal { | ||
| static instanceCount = 0; | ||
| #id = getShardedWalId(); | ||
| groupId = getUniqueTimeId(); | ||
| #format; | ||
| #dir = process.cwd(); | ||
| #isCoordinator; | ||
| /** | ||
| * Create a sharded WAL manager. | ||
| * | ||
| * @param opt.dir - Base directory to store shard files (defaults to process.cwd()) | ||
| * @param opt.format - WAL format configuration | ||
| * @param opt.groupId - Group ID for sharding (defaults to generated group ID) | ||
| * @param opt.coordinatorIdEnvVar - Environment variable name for storing coordinator ID (defaults to CP_SHARDED_WAL_COORDINATOR_ID) | ||
| */ | ||
| constructor(opt) { | ||
| const { dir, format, groupId, coordinatorIdEnvVar } = opt; | ||
| this.groupId = groupId ?? getUniqueTimeId(); | ||
| if (dir) { | ||
| this.#dir = dir; | ||
| } | ||
| this.#format = parseWalFormat(format); | ||
| this.#isCoordinator = isCoordinatorProcess(coordinatorIdEnvVar, this.#id); | ||
| } | ||
| /** | ||
| * Is this instance the coordinator? | ||
| * | ||
| * Coordinator status is determined from the coordinatorIdEnvVar environment variable. | ||
| * The coordinator handles finalization and cleanup of shard files. | ||
| * | ||
| * @returns true if this instance is the coordinator, false otherwise | ||
| */ | ||
| isCoordinator() { | ||
| return this.#isCoordinator; | ||
| } | ||
| shard(shardId = getUniqueInstanceId(shardCounter)) { | ||
| return new WriteAheadLogFile({ | ||
| file: getShardedPath({ | ||
| dir: this.#dir, | ||
| format: this.#format, | ||
| groupId: this.groupId, | ||
| shardId, | ||
| }), | ||
| codec: this.#format.codec, | ||
| }); | ||
| } | ||
| /** Get all shard file paths matching this WAL's base name */ | ||
| shardFiles() { | ||
| if (!fs.existsSync(this.#dir)) { | ||
| return []; | ||
| } | ||
| const groupIdDir = path.dirname(getShardedFinalPath({ | ||
| dir: this.#dir, | ||
| format: this.#format, | ||
| groupId: this.groupId, | ||
| })); | ||
| // create dir if not existing | ||
| ensureDirectoryExistsSync(groupIdDir); | ||
| return fs | ||
| .readdirSync(groupIdDir) | ||
| .filter(entry => entry.endsWith(this.#format.walExtension)) | ||
| .filter(entry => entry.startsWith(`${this.#format.baseName}`)) | ||
| .map(entry => path.join(groupIdDir, entry)); | ||
| } | ||
| /** | ||
| * Finalize all shards by merging them into a single output file. | ||
| * Recovers all records from all shards, validates no errors, and writes merged result. | ||
| * @throws Error if any shard contains decode errors | ||
| */ | ||
| finalize(opt) { | ||
| const fileRecoveries = this.shardFiles().map(f => ({ | ||
| file: f, | ||
| recovery: new WriteAheadLogFile({ | ||
| file: f, | ||
| codec: this.#format.codec, | ||
| }).recover(), | ||
| })); | ||
| const records = fileRecoveries.flatMap(({ recovery }) => recovery.records); | ||
| // Check if any records are invalid entries (from tolerant codec) | ||
| const hasInvalidEntries = records.some(r => typeof r === 'object' && r != null && '__invalid' in r); | ||
| const recordsToFinalize = hasInvalidEntries | ||
| ? records | ||
| : filterValidRecords(records); | ||
| const out = getShardedFinalPath({ | ||
| dir: this.#dir, | ||
| format: this.#format, | ||
| groupId: this.groupId, | ||
| }); | ||
| ensureDirectoryExistsSync(path.dirname(out)); | ||
| fs.writeFileSync(out, this.#format.finalizer(recordsToFinalize, opt)); | ||
| } | ||
| cleanup() { | ||
| this.shardFiles().forEach(f => { | ||
| // Remove the shard file | ||
| fs.unlinkSync(f); | ||
| // Remove the parent directory (shard group directory) | ||
| const shardDir = path.dirname(f); | ||
| try { | ||
| fs.rmdirSync(shardDir); | ||
| } | ||
| catch { | ||
| // Directory might not be empty or already removed, ignore | ||
| } | ||
| }); | ||
| // Also try to remove the root directory if it becomes empty | ||
| try { | ||
| fs.rmdirSync(this.#dir); | ||
| } | ||
| catch { | ||
| // Directory might not be empty or already removed, ignore | ||
| } | ||
| } | ||
| } | ||
| //# sourceMappingURL=wal.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"wal.js","sourceRoot":"","sources":["../../../src/lib/wal.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAEL,mBAAmB,EACnB,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAiEzB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAgB,KAGlD,EAAiC,EAAE;IAClC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEjC,OAAO;QACL,MAAM,EAAE,CAAC,CAAC,EAAE,CACV,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,WAAW,IAAI,CAAC;YAC5C,CAAC,CAAE,CAAqB,CAAC,GAAG;YAC5B,CAAC,CAAC,MAAM,CAAC,CAAM,CAAC;QACpB,MAAM,EAAE,CAAC,CAAC,EAAE;YACV,IAAI,CAAC;gBACH,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;YACnB,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;YACrC,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAChC,OAAsC;IAEtC,OAAO,OAAO;SACX,MAAM,CACL,CAAC,CAAC,EAAU,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,IAAI,IAAI,IAAI,WAAW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L,OAAO;QACL,QAAQ;QACR,YAAY;QACZ,cAAc;QACd,KAAK;QACL,SAAS;KACa,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAe;IACvD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"} |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 12 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 12 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
522608
3.18%206
1.48%8451
3.96%24
-7.69%+ Added
- Removed
Updated