Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const createTrace = outputPath => {
const trace = new Tracer({
noStream: true,
})
const profiler = new Profiler(inspector)
if (/\/|\\/.test(outputPath)) {
const dirPath = path.dirname(outputPath)
mkdirp.sync(dirPath)
}
const fsStream = fs.createWriteStream(outputPath)
let counter = 0
trace.pipe(fsStream)
// These are critical events that need to be inserted so that tools like
// chrome dev tools can load the profile.
trace.instantEvent({
name: 'TracingStartedInPage',
const createTrace = outputPath => {
const trace = new Tracer({
noStream: true
});
const profiler = new Profiler(inspector);
if (/\/|\\/.test(outputPath)) {
const dirPath = path.dirname(outputPath);
mkdirp.sync(dirPath);
}
const fsStream = fs.createWriteStream(outputPath);
let counter = 0;
trace.pipe(fsStream);
// These are critical events that need to be inserted so that tools like
// chrome dev tools can load the profile.
trace.instantEvent({
name: "TracingStartedInPage",
const createTrace = outputPath => {
const trace = new Tracer({
noStream: true
});
const profiler = new Profiler(inspector);
const fsStream = fs.createWriteStream(outputPath);
let counter = 0;
trace.pipe(fsStream);
// These are critical events that need to be inserted so that tools like
// chrome dev tools can load the profile.
trace.instantEvent({
name: "TracingStartedInPage",
id: ++counter,
cat: ["disabled-by-default-devtools.timeline"],
args: {
data: {
function createTrace(outputPath) {
const trace = new Tracer({
noStream: true
});
const profiler = new Profiler(inspector);
const fsStream = fs.createWriteStream(outputPath);
let counter = 0;
trace.pipe(fsStream);
// These are critical events that need to be inserted so that tools like
// chrome dev tools can load the profile.
trace.instantEvent({
name: "TracingStartedInPage",
id: ++counter,
cat: ["disabled-by-default-devtools.timeline"],
args: {
data: {
constructor() {
this.tracer = new Tracer();
this.tid = 0;
this.eventId = 0;
this.init();
}