Skip to content

Commit ad83c42

Browse files
committed
refactor: simplify trace types and helper
1 parent 7b6e72c commit ad83c42

15 files changed

+1078
-802
lines changed

packages/utils/src/lib/create-runner-files.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { writeFile } from 'node:fs/promises';
22
import path from 'node:path';
3-
import { threadId } from 'node:worker_threads';
43
import type { RunnerFilesPaths } from '@code-pushup/models';
54
import { ensureDirectoryExists, pluginWorkDir } from './file-system.js';
5+
import { getUniqueProcessThreadId } from './process-id.js';
66

77
/**
88
* Function to create timestamp nested plugin runner files for config and output.
@@ -14,9 +14,7 @@ export async function createRunnerFiles(
1414
pluginSlug: string,
1515
configJSON: string,
1616
): Promise<RunnerFilesPaths> {
17-
// Use timestamp + process ID + threadId
18-
// This prevents race conditions when running the same plugin for multiple projects in parallel
19-
const uniqueId = `${(performance.timeOrigin + performance.now()) * 10}-${process.pid}-${threadId}`;
17+
const uniqueId = getUniqueProcessThreadId();
2018
const runnerWorkDir = path.join(pluginWorkDir(pluginSlug), uniqueId);
2119
const runnerConfigPath = path.join(runnerWorkDir, 'plugin-config.json');
2220
const runnerOutputPath = path.join(runnerWorkDir, 'runner-output.json');
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
import process from 'node:process';
2+
import { threadId } from 'node:worker_threads';
3+
4+
/**
5+
* Counter interface for generating sequential instance IDs.
6+
* Encapsulates increment logic within the counter-implementation.
7+
*/
8+
export type Counter = {
9+
/**
10+
* Returns the next counter-value and increments the internal state.
11+
* @returns The next counter-value
12+
*/
13+
next: () => number;
14+
};
15+
16+
/**
17+
* Base regex pattern for time ID format: yyyymmdd-hhmmss-ms
18+
*/
19+
export const TIME_ID_BASE = /\d{8}-\d{6}-\d{3}/;
20+
21+
/**
22+
* Regex patterns for validating process and instance ID formats.
23+
* All patterns use strict anchors (^ and $) to ensure complete matches.
24+
*/
25+
export const ID_PATTERNS = Object.freeze({
26+
/**
27+
* Time ID / Run ID format: yyyymmdd-hhmmss-ms
28+
* Example: "20240101-120000-000"
29+
* Used by: getUniqueTimeId()
30+
*/
31+
TIME_ID: new RegExp(`^${TIME_ID_BASE.source}$`),
32+
/**
33+
* Group ID format: alias by convention, semantically represents a group of instances
34+
* Example: "20240101-120000-000"
35+
* Used by: grouping related instances by time
36+
*/
37+
GROUP_ID: new RegExp(`^${TIME_ID_BASE.source}$`),
38+
/**
39+
* Process/Thread ID format: timeId-pid-threadId
40+
* Example: "20240101-120000-000-12345-1"
41+
* Used by: getUniqueProcessThreadId()
42+
*/
43+
PROCESS_THREAD_ID: new RegExp(`^${TIME_ID_BASE.source}-\\d+-\\d+$`),
44+
/**
45+
* Instance ID format: timeId.pid.threadId.counter
46+
* Example: "20240101-120000-000.12345.1.1"
47+
* Used by: getUniqueInstanceId()
48+
*/
49+
INSTANCE_ID: new RegExp(`^${TIME_ID_BASE.source}\\.\\d+\\.\\d+\\.\\d+$`),
50+
/** @deprecated Use INSTANCE_ID instead */
51+
SHARD_ID: new RegExp(`^${TIME_ID_BASE.source}\\.\\d+\\.\\d+\\.\\d+$`),
52+
/** @deprecated Use TIME_ID instead */
53+
READABLE_DATE: new RegExp(`^${TIME_ID_BASE.source}$`),
54+
} as const);
55+
56+
/**
57+
* Generates a unique run ID.
58+
* This ID uniquely identifies a run/execution with a globally unique, sortable, human-readable date string.
59+
* Format: yyyymmdd-hhmmss-ms
60+
* Example: "20240101-120000-000"
61+
*
62+
* @returns A unique run ID string in readable date format
63+
*/
64+
export function getUniqueTimeId(): string {
65+
return sortableReadableDateString(
66+
Math.floor(performance.timeOrigin + performance.now()),
67+
);
68+
}
69+
70+
/**
71+
* Generates a unique process/thread ID.
72+
* This ID uniquely identifies a process/thread execution and prevents race conditions when running
73+
* the same plugin for multiple projects in parallel.
74+
* Format: timeId-pid-threadId
75+
* Example: "20240101-120000-000-12345-1"
76+
*
77+
* @returns A unique ID string combining timestamp, process ID, and thread ID
78+
*/
79+
export function getUniqueProcessThreadId(): string {
80+
return `${getUniqueTimeId()}-${process.pid}-${threadId}`;
81+
}
82+
83+
/**
84+
* Generates a unique instance ID based on performance time origin, process ID, thread ID, and instance count.
85+
* This ID uniquely identifies an instance across processes and threads.
86+
* Format: timestamp.pid.threadId.counter
87+
* Example: "20240101-120000-000.12345.1.1"
88+
*
89+
* @param counter - Counter that provides the next instance count value
90+
* @returns A unique ID string combining timestamp, process ID, thread ID, and counter
91+
*/
92+
export function getUniqueInstanceId(counter: Counter): string {
93+
return `${getUniqueTimeId()}.${process.pid}.${threadId}.${counter.next()}`;
94+
}
95+
96+
/**
97+
* Converts a timestamp in milliseconds to a sortable, human-readable date string.
98+
* Format: yyyymmdd-hhmmss-ms
99+
* Example: "20240101-120000-000"
100+
*
101+
* @param timestampMs - Timestamp in milliseconds
102+
* @returns A sortable date string in yyyymmdd-hhmmss-ms format
103+
*/
104+
export function sortableReadableDateString(timestampMs: number): string {
105+
const date = new Date(timestampMs);
106+
const MILLISECONDS_PER_SECOND = 1000;
107+
const yyyy = date.getFullYear();
108+
const mm = String(date.getMonth() + 1).padStart(2, '0');
109+
const dd = String(date.getDate()).padStart(2, '0');
110+
const hh = String(date.getHours()).padStart(2, '0');
111+
const min = String(date.getMinutes()).padStart(2, '0');
112+
const ss = String(date.getSeconds()).padStart(2, '0');
113+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
114+
const ms = String(timestampMs % MILLISECONDS_PER_SECOND).padStart(3, '0');
115+
116+
return `${yyyy}${mm}${dd}-${hh}${min}${ss}-${ms}`;
117+
}
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
import { threadId } from 'node:worker_threads';
2+
import { vi } from 'vitest';
3+
import {
4+
type Counter,
5+
ID_PATTERNS,
6+
TIME_ID_BASE,
7+
getUniqueInstanceId,
8+
getUniqueProcessThreadId,
9+
getUniqueTimeId,
10+
sortableReadableDateString,
11+
} from './process-id.js';
12+
13+
describe('TIME_ID_BASE', () => {
14+
it.each([
15+
'20231114-221320-000',
16+
'20240101-120000-000',
17+
'20231231-235959-999',
18+
])('should match valid time ID format: %s', timeId => {
19+
expect(timeId).toMatch(TIME_ID_BASE);
20+
});
21+
22+
it.each(['2023-11-14', '20231114', '20231114-221320', 'invalid'])(
23+
'should not match invalid time ID format: %s',
24+
timeId => {
25+
expect(timeId).not.toMatch(TIME_ID_BASE);
26+
},
27+
);
28+
});
29+
30+
describe('ID_PATTERNS', () => {
31+
it.each(['20231114-221320-000', '20240101-120000-000'])(
32+
'TIME_ID should match valid time ID: %s',
33+
timeId => {
34+
expect(timeId).toMatch(ID_PATTERNS.TIME_ID);
35+
},
36+
);
37+
38+
it.each(['20231114-221320-000.123', '20231114-221320'])(
39+
'TIME_ID should not match invalid format: %s',
40+
timeId => {
41+
expect(timeId).not.toMatch(ID_PATTERNS.TIME_ID);
42+
},
43+
);
44+
45+
it.each(['20231114-221320-000'])(
46+
'GROUP_ID should match valid group ID: %s',
47+
groupId => {
48+
expect(groupId).toMatch(ID_PATTERNS.GROUP_ID);
49+
},
50+
);
51+
52+
it.each(['20231114-221320-000-12345-1', '20240101-120000-000-99999-99'])(
53+
'PROCESS_THREAD_ID should match valid process/thread ID: %s',
54+
processThreadId => {
55+
expect(processThreadId).toMatch(ID_PATTERNS.PROCESS_THREAD_ID);
56+
},
57+
);
58+
59+
it.each(['20231114-221320-000', '20231114-221320-000-12345'])(
60+
'PROCESS_THREAD_ID should not match invalid format: %s',
61+
processThreadId => {
62+
expect(processThreadId).not.toMatch(ID_PATTERNS.PROCESS_THREAD_ID);
63+
},
64+
);
65+
66+
it.each(['20231114-221320-000.12345.1.1', '20240101-120000-000.99999.99.42'])(
67+
'INSTANCE_ID should match valid instance ID: %s',
68+
instanceId => {
69+
expect(instanceId).toMatch(ID_PATTERNS.INSTANCE_ID);
70+
},
71+
);
72+
73+
it.each(['20231114-221320-000', '20231114-221320-000-12345-1'])(
74+
'INSTANCE_ID should not match invalid format: %s',
75+
instanceId => {
76+
expect(instanceId).not.toMatch(ID_PATTERNS.INSTANCE_ID);
77+
},
78+
);
79+
80+
it.each(['20231114-221320-000.12345.1.1'])(
81+
'SHARD_ID should match valid shard ID (deprecated alias): %s',
82+
shardId => {
83+
expect(shardId).toMatch(ID_PATTERNS.SHARD_ID);
84+
},
85+
);
86+
87+
it.each(['20231114-221320-000'])(
88+
'READABLE_DATE should match valid readable date (deprecated alias): %s',
89+
readableDate => {
90+
expect(readableDate).toMatch(ID_PATTERNS.READABLE_DATE);
91+
},
92+
);
93+
});
94+
95+
describe('sortableReadableDateString', () => {
96+
it('should format timestamp correctly', () => {
97+
const timestamp = 1_700_000_000_000; // 2023-11-14 22:13:20.000
98+
const result = sortableReadableDateString(timestamp);
99+
expect(result).toBe('20231114-221320-000');
100+
expect(result).toMatch(TIME_ID_BASE);
101+
});
102+
});
103+
104+
describe('getUniqueTimeId', () => {
105+
it('should generate time ID with mocked timeOrigin', () => {
106+
const result = getUniqueTimeId();
107+
108+
expect(result).toMatch(ID_PATTERNS.TIME_ID);
109+
expect(result).toMatch(ID_PATTERNS.GROUP_ID);
110+
expect(result).toBe('20231114-221320-000');
111+
});
112+
113+
it('should generate new ID on each call (not idempotent)', () => {
114+
let callCount = 0;
115+
vi.spyOn(performance, 'now').mockImplementation(() => callCount++);
116+
117+
const id1 = getUniqueTimeId();
118+
const id2 = getUniqueTimeId();
119+
120+
expect(id1).not.toBe(id2);
121+
expect(id1).toMatch(ID_PATTERNS.TIME_ID);
122+
expect(id2).toMatch(ID_PATTERNS.TIME_ID);
123+
});
124+
});
125+
126+
describe('getUniqueProcessThreadId', () => {
127+
it('should generate process/thread ID with correct format', () => {
128+
const result = getUniqueProcessThreadId();
129+
130+
expect(result).toMatch(ID_PATTERNS.PROCESS_THREAD_ID);
131+
expect(result).toContain(`-10001-${threadId}`);
132+
expect(result).toStartWith('20231114-221320-000');
133+
});
134+
135+
it('should generate new ID on each call (not idempotent)', () => {
136+
let callCount = 0;
137+
vi.spyOn(performance, 'now').mockImplementation(() => callCount++);
138+
139+
const id1 = getUniqueProcessThreadId();
140+
const id2 = getUniqueProcessThreadId();
141+
142+
expect(id1).not.toBe(id2);
143+
expect(id1).toMatch(ID_PATTERNS.PROCESS_THREAD_ID);
144+
expect(id2).toMatch(ID_PATTERNS.PROCESS_THREAD_ID);
145+
});
146+
});
147+
148+
describe('getUniqueInstanceId', () => {
149+
it('should generate instance ID with correct format', () => {
150+
let counter = 0;
151+
const counterObj: Counter = {
152+
next: () => ++counter,
153+
};
154+
155+
const result = getUniqueInstanceId(counterObj);
156+
157+
expect(result).toMatch(ID_PATTERNS.INSTANCE_ID);
158+
expect(result).toStartWith('20231114-221320-000.');
159+
expect(result).toContain(`.10001.${threadId}.`);
160+
expect(result).toEndWith('.1');
161+
});
162+
163+
it('should use counter to generate incrementing instance IDs', () => {
164+
let counter = 0;
165+
const counterObj: Counter = {
166+
next: () => ++counter,
167+
};
168+
169+
const results = [
170+
getUniqueInstanceId(counterObj),
171+
getUniqueInstanceId(counterObj),
172+
getUniqueInstanceId(counterObj),
173+
];
174+
175+
const counters = results.map(r =>
176+
Number.parseInt(r.split('.').at(-1)!, 10),
177+
);
178+
expect(counters).toEqual([1, 2, 3]);
179+
});
180+
181+
it('should generate different IDs for different calls', () => {
182+
let counter = 0;
183+
const counterObj: Counter = {
184+
next: () => ++counter,
185+
};
186+
187+
expect(getUniqueInstanceId(counterObj)).not.toBe(
188+
getUniqueInstanceId(counterObj),
189+
);
190+
});
191+
});
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{"cat":"blink.user_timing","ph":"i","name":"stats-profiler:operation-1:start","pid":10001,"tid":1,"ts":1700000005000000,"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
2-
{"cat":"blink.user_timing","ph":"b","name":"stats-profiler:operation-1","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000001,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
3-
{"cat":"blink.user_timing","ph":"e","name":"stats-profiler:operation-1","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000002,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
4-
{"cat":"blink.user_timing","ph":"i","name":"stats-profiler:operation-1:end","pid":10001,"tid":1,"ts":1700000005000003,"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
5-
{"cat":"blink.user_timing","ph":"i","name":"stats-profiler:operation-2:start","pid":10001,"tid":1,"ts":1700000005000004,"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
6-
{"cat":"blink.user_timing","ph":"b","name":"stats-profiler:operation-2","id2":{"local":"0x2"},"pid":10001,"tid":1,"ts":1700000005000005,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
7-
{"cat":"blink.user_timing","ph":"e","name":"stats-profiler:operation-2","id2":{"local":"0x2"},"pid":10001,"tid":1,"ts":1700000005000006,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
8-
{"cat":"blink.user_timing","ph":"i","name":"stats-profiler:operation-2:end","pid":10001,"tid":1,"ts":1700000005000007,"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
1+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000000,"name":"stats-profiler:operation-1:start","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
2+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000001,"name":"stats-profiler:operation-1","ph":"b","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
3+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000002,"name":"stats-profiler:operation-1","ph":"e","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
4+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000003,"name":"stats-profiler:operation-1:end","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
5+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000004,"name":"stats-profiler:operation-2:start","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
6+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000005,"name":"stats-profiler:operation-2","ph":"b","id2":{"local":"0x2"},"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
7+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000006,"name":"stats-profiler:operation-2","ph":"e","id2":{"local":"0x2"},"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
8+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000007,"name":"stats-profiler:operation-2:end","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"cat":"blink.user_timing","ph":"i","name":"api-server:user-lookup:start","pid":10001,"tid":1,"ts":1700000005000000,"args":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}
2-
{"cat":"blink.user_timing","ph":"b","name":"api-server:user-lookup","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000001,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}}
3-
{"cat":"blink.user_timing","ph":"e","name":"api-server:user-lookup","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000002,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}}
4-
{"cat":"blink.user_timing","ph":"i","name":"api-server:user-lookup:end","pid":10001,"tid":1,"ts":1700000005000003,"args":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}
1+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000000,"name":"api-server:user-lookup:start","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}}
2+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000001,"name":"api-server:user-lookup","ph":"b","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}
3+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000002,"name":"api-server:user-lookup","ph":"e","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}
4+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000003,"name":"api-server:user-lookup:end","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"cat":"blink.user_timing","ph":"i","name":"write-test:test-operation:start","pid":10001,"tid":1,"ts":1700000005000000,"args":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}
2-
{"cat":"blink.user_timing","ph":"b","name":"write-test:test-operation","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000001,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}}
3-
{"cat":"blink.user_timing","ph":"e","name":"write-test:test-operation","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000002,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}}
4-
{"cat":"blink.user_timing","ph":"i","name":"write-test:test-operation:end","pid":10001,"tid":1,"ts":1700000005000003,"args":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}
1+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000000,"name":"write-test:test-operation:start","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}}
2+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000001,"name":"write-test:test-operation","ph":"b","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}
3+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000002,"name":"write-test:test-operation","ph":"e","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}
4+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000003,"name":"write-test:test-operation:end","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}}

packages/utils/src/lib/profiler/constants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ export const PROFILER_DEBUG_ENV_VAR = 'CP_PROFILER_DEBUG';
2525
*/
2626
export const SHARDED_WAL_COORDINATOR_ID_ENV_VAR =
2727
'CP_SHARDED_WAL_COORDINATOR_ID';
28+
29+
/**
30+
* Default base name for WAL files.
31+
* Used as the base name for sharded WAL files (e.g., "trace" in "trace.json").
32+
*/
33+
export const PROFILER_PERSIST_BASENAME = 'trace';

packages/utils/src/lib/profiler/profiler-node.int.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import type { PerformanceEntryEncoder } from '../performance-observer.js';
88
import { WAL_ID_PATTERNS } from '../wal.js';
99
import { NodejsProfiler } from './profiler-node.js';
1010
import { entryToTraceEvents } from './trace-file-utils.js';
11-
import type { UserTimingTraceEvent } from './trace-file.type.js';
11+
import type { TraceEvent } from './trace-file.type.js';
1212

1313
describe('NodeJS Profiler Integration', () => {
14-
const traceEventEncoder: PerformanceEntryEncoder<UserTimingTraceEvent> =
14+
const traceEventEncoder: PerformanceEntryEncoder<TraceEvent> =
1515
entryToTraceEvents;
1616

17-
let nodejsProfiler: NodejsProfiler<UserTimingTraceEvent>;
17+
let nodejsProfiler: NodejsProfiler<TraceEvent>;
1818

1919
beforeEach(() => {
2020
performance.clearMarks();

0 commit comments

Comments
 (0)