@apica-io/asm-pm-runner
Version:
Run a postman collection in Apica ASM.
47 lines • 1.92 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.initBaseResult = initBaseResult;
exports.incrementTimingPhases = incrementTimingPhases;
exports.roundTimingPhases = roundTimingPhases;
;
function initBaseResult(result, name) {
result.name = name;
result.content_length = result.duration_ms = 0;
result.end_timestamp_ms = result.start_timestamp_ms = Date.now();
result.metrics =
{
"dns_time_ms": 0,
"download_time_ms": 0,
"prepare": 0,
"process_time_ms": 0,
"secure_handshake_ms": 0,
"socket_wait_ms": 0,
"tcp_connect_ms": 0,
"time_to_first_byte_ms": 0,
"total_time_ms": 0
};
return result;
}
function incrementTimingPhases(base, add) {
base.dns_time_ms += add.dns_time_ms;
base.download_time_ms += add.download_time_ms;
base.prepare += add.prepare;
base.process_time_ms += add.process_time_ms;
base.secure_handshake_ms += add.secure_handshake_ms;
base.socket_wait_ms += add.socket_wait_ms;
base.tcp_connect_ms += add.tcp_connect_ms;
base.time_to_first_byte_ms += add.time_to_first_byte_ms;
base.total_time_ms += add.total_time_ms;
}
function roundTimingPhases(timings) {
timings.dns_time_ms = Math.round(timings.dns_time_ms);
timings.download_time_ms = Math.round(timings.download_time_ms);
timings.prepare = Math.round(timings.prepare);
timings.process_time_ms = Math.round(timings.process_time_ms);
timings.secure_handshake_ms = Math.round(timings.secure_handshake_ms);
timings.socket_wait_ms = Math.round(timings.socket_wait_ms);
timings.tcp_connect_ms = Math.round(timings.tcp_connect_ms);
timings.time_to_first_byte_ms = Math.round(timings.time_to_first_byte_ms);
timings.total_time_ms = Math.round(timings.total_time_ms);
}
//# sourceMappingURL=crsformat.js.map