metrics.js
1 "use strict"; 2 Object.defineProperty(exports, "__esModule", { value: true }); 3 exports.notInstrumented = exports.PageInvocationPoint = exports.EMPTY_LINTED_METRICS_EVENT = void 0; 4 /** 5 * An empty linted metrics event. 6 * 7 * The empty events should be skipped from recording 8 * by metrics event recorders. 9 */ 10 exports.EMPTY_LINTED_METRICS_EVENT = { 11 fields: {}, 12 issues: [], 13 }; 14 var PageInvocationPoint; 15 (function (PageInvocationPoint) { 16 PageInvocationPoint["pageEnter"] = "pageEnter"; 17 PageInvocationPoint["pageExit"] = "pageExit"; 18 PageInvocationPoint["appExit"] = "appExit"; 19 PageInvocationPoint["appEnter"] = "appEnter"; 20 PageInvocationPoint["backButton"] = "backButton"; 21 })(PageInvocationPoint = exports.PageInvocationPoint || (exports.PageInvocationPoint = {})); 22 /** 23 * Returns an empty metrics instance of the specified metrics type. 24 * @param metricsType - Type of the metrics data to return. 25 * 26 * @deprecated Do not use, all metrics events should be instrumented. 27 */ 28 function notInstrumented(metricsType) { 29 switch (metricsType) { 30 case 0 /* NotInstrumentedMetricsType.ActionMetrics */: 31 return { 32 data: [], 33 custom: {}, 34 }; 35 case 1 /* NotInstrumentedMetricsType.FetchTimingMetrics */: 36 return {}; 37 case 2 /* NotInstrumentedMetricsType.PageMetrics */: 38 return { 39 instructions: [], 40 custom: {}, 41 }; 42 case 3 /* NotInstrumentedMetricsType.ImpressionMetrics */: 43 return { 44 id: { 45 id: "", 46 impressionIndex: NaN, 47 }, 48 fields: {}, 49 custom: {}, 50 }; 51 default: 52 return {}; 53 } 54 } 55 exports.notInstrumented = notInstrumented; 56 // endregion 57 //# sourceMappingURL=metrics.js.map