Skip to content

Commit 16bde1c

Browse files
committed
wip
1 parent dfaf95d commit 16bde1c

File tree

2 files changed

+6
-165
lines changed

2 files changed

+6
-165
lines changed

tools/perf.observer.js

Lines changed: 0 additions & 156 deletions
This file was deleted.

tools/perf_hooks.patch.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Performance, performance} from "node:perf_hooks";
22
import {basename} from "node:path";
33

44
// Global array to store complete events.
5-
const trace = [];
5+
const traceEvents = [];
66

77
// Metadata events.
88

@@ -104,16 +104,14 @@ Performance.prototype.measure = function(name, start, end, options) {
104104
};
105105

106106
// Push metadata events once.
107-
if (trace.length < 1) {
108-
trace.push(threadMetadata);
107+
if (traceEvents.length < 1) {
108+
traceEvents.push(threadMetadata);
109109
console.log(`traceEvent:JSON:${JSON.stringify(threadMetadata)}`);
110-
trace.push(processMetadata);
110+
traceEvents.push(processMetadata);
111111
console.log(`traceEvent:JSON:${JSON.stringify(processMetadata)}`);
112112
}
113-
trace.push(event);
113+
traceEvents.push(event);
114114
console.log(`traceEvent:JSON:${JSON.stringify(event)}`);
115-
116-
// console.log('Measure Event:', JSON.stringify(event));
117115
} else {
118116
console.warn('Missing start or end mark for measure', name);
119117
}
@@ -148,8 +146,7 @@ performance.profile = function() {
148146
}
149147
}
150148
},
151-
traceEvents: trace
149+
traceEvents
152150
};
153151
};
154-
performance.trace = trace;
155152

0 commit comments

Comments
 (0)