"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createCDPPerformance = exports.timeStart = exports.aegis = void 0;
const tslib_1 = require("tslib");
/* eslint-disable @typescript-eslint/no-unused-vars */
const aegis_1 = tslib_1.__importDefault(require("@/patch/aegis"));
const config_1 = require("@/config");
const package_json_1 = require("../../package.json");
exports.aegis = new aegis_1.default({
    id: config_1.config.aegisId,
    selector: {
        type: 'host',
    },
    version: package_json_1.version,
    // protocol: 'http',
});
const timeStart = (name) => {
    const start = Date.now();
    return (ext = {}) => {
        const end = Date.now();
        const duration = end - start;
        exports.aegis.reportTime({
            name,
            duration,
            ...ext,
            ext3: config_1.config.isCluster ? 'remote' : 'local',
        });
    };
};
exports.timeStart = timeStart;
const createCDPPerformance = (perf) => ({
    devtoolsToDebugServer: 0,
    debugServerReceiveFromDevtools: 0,
    debugServerToDevtools: 0,
    devtoolsReceive: 0,
    ...(perf || {}),
});
exports.createCDPPerformance = createCDPPerformance;
