in src/models/console/consoleTrace.ts [16:72]
constructor(trace: Trace) {
this.totalExecutionTime = 0;
if (trace.traceEntries.inbound) {
this.inbound = new Array<ConsoleTraceEntry>();
this.inboundExecutionTime = 0;
for (const entry of trace.traceEntries.inbound) {
const elapsed = this.parseElapsedTime(entry.elapsed);
const consoleEntry = new ConsoleTraceEntry();
consoleEntry.source = entry.source;
consoleEntry.data = entry.data;
consoleEntry.executionTime = elapsed - this.totalExecutionTime;
this.inboundExecutionTime += consoleEntry.executionTime;
this.inbound.push(consoleEntry);
this.totalExecutionTime = elapsed;
}
}
if (trace.traceEntries.backend) {
this.backend = new Array<ConsoleTraceEntry>();
this.backendExecutionTime = 0;
for (const entry of trace.traceEntries.backend) {
const elapsed = this.parseElapsedTime(entry.elapsed);
const consoleEntry = new ConsoleTraceEntry();
consoleEntry.source = entry.source;
consoleEntry.data = entry.data;
consoleEntry.executionTime = elapsed - this.totalExecutionTime;
this.backendExecutionTime += consoleEntry.executionTime;
this.backend.push(consoleEntry);
this.totalExecutionTime = elapsed;
}
}
if (trace.traceEntries.outbound) {
this.outbound = new Array<ConsoleTraceEntry>();
this.outboundExecutionTime = 0;
for (const entry of trace.traceEntries.outbound) {
const elapsed = this.parseElapsedTime(entry.elapsed);
const consoleEntry = new ConsoleTraceEntry();
consoleEntry.source = entry.source;
consoleEntry.data = entry.data;
consoleEntry.executionTime = elapsed - this.totalExecutionTime;
this.outboundExecutionTime += consoleEntry.executionTime;
this.outbound.push(consoleEntry);
this.totalExecutionTime = elapsed;
}
}
}