@fluidframework/telemetry-utils 2.0.0-rc.1.0.3 → 2.0.0-rc.2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +23 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -2
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/telemetry-utils.api.md +10 -33
- package/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -3
- package/dist/config.js.map +1 -1
- package/dist/error.d.ts +2 -2
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +9 -9
- package/dist/error.js.map +1 -1
- package/dist/errorLogging.d.ts +4 -4
- package/dist/errorLogging.d.ts.map +1 -1
- package/dist/errorLogging.js +19 -60
- package/dist/errorLogging.js.map +1 -1
- package/dist/eventEmitterWithErrorHandling.d.ts +1 -1
- package/dist/eventEmitterWithErrorHandling.js +1 -1
- package/dist/eventEmitterWithErrorHandling.js.map +1 -1
- package/dist/events.d.ts +2 -3
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/fluidErrorBase.d.ts +4 -3
- package/dist/fluidErrorBase.d.ts.map +1 -1
- package/dist/fluidErrorBase.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +58 -60
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +7 -23
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +12 -29
- package/dist/logger.js.map +1 -1
- package/dist/mockLogger.d.ts +1 -1
- package/dist/mockLogger.d.ts.map +1 -1
- package/dist/mockLogger.js +2 -2
- package/dist/mockLogger.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/sampledTelemetryHelper.d.ts +4 -4
- package/dist/sampledTelemetryHelper.d.ts.map +1 -1
- package/dist/sampledTelemetryHelper.js +1 -1
- package/dist/sampledTelemetryHelper.js.map +1 -1
- package/dist/telemetry-utils-alpha.d.ts +4 -15
- package/dist/telemetry-utils-beta.d.ts +4 -32
- package/dist/telemetry-utils-public.d.ts +4 -32
- package/dist/telemetry-utils-untrimmed.d.ts +11 -50
- package/dist/thresholdCounter.d.ts +1 -1
- package/dist/thresholdCounter.d.ts.map +1 -1
- package/dist/thresholdCounter.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/utils.d.ts +1 -20
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +3 -27
- package/dist/utils.js.map +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +1 -1
- package/lib/config.js.map +1 -1
- package/lib/error.d.ts +2 -2
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +1 -1
- package/lib/error.js.map +1 -1
- package/lib/errorLogging.d.ts +4 -4
- package/lib/errorLogging.d.ts.map +1 -1
- package/lib/errorLogging.js +15 -56
- package/lib/errorLogging.js.map +1 -1
- package/lib/eventEmitterWithErrorHandling.d.ts +1 -1
- package/lib/eventEmitterWithErrorHandling.js +1 -1
- package/lib/eventEmitterWithErrorHandling.js.map +1 -1
- package/lib/events.d.ts +2 -3
- package/lib/events.d.ts.map +1 -1
- package/lib/events.js.map +1 -1
- package/lib/fluidErrorBase.d.ts +4 -3
- package/lib/fluidErrorBase.d.ts.map +1 -1
- package/lib/fluidErrorBase.js.map +1 -1
- package/lib/index.d.ts +12 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -11
- package/lib/index.js.map +1 -1
- package/lib/logger.d.ts +7 -23
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +3 -19
- package/lib/logger.js.map +1 -1
- package/lib/mockLogger.d.ts +1 -1
- package/lib/mockLogger.d.ts.map +1 -1
- package/lib/mockLogger.js +1 -1
- package/lib/mockLogger.js.map +1 -1
- package/lib/sampledTelemetryHelper.d.ts +4 -4
- package/lib/sampledTelemetryHelper.d.ts.map +1 -1
- package/lib/sampledTelemetryHelper.js +1 -1
- package/lib/sampledTelemetryHelper.js.map +1 -1
- package/lib/{telemetry-utils-alpha.d.mts → telemetry-utils-alpha.d.ts} +4 -15
- package/lib/{telemetry-utils-beta.d.mts → telemetry-utils-beta.d.ts} +4 -32
- package/lib/{telemetry-utils-public.d.mts → telemetry-utils-public.d.ts} +4 -32
- package/lib/{telemetry-utils-untrimmed.d.mts → telemetry-utils-untrimmed.d.ts} +11 -50
- package/lib/test/EventEmitterWithErrorHandling.spec.js +86 -0
- package/lib/test/EventEmitterWithErrorHandling.spec.js.map +1 -0
- package/lib/test/childLogger.spec.js +233 -0
- package/lib/test/childLogger.spec.js.map +1 -0
- package/lib/test/config.spec.js +229 -0
- package/lib/test/config.spec.js.map +1 -0
- package/lib/test/error.spec.js +161 -0
- package/lib/test/error.spec.js.map +1 -0
- package/lib/test/errorLogging.spec.js +801 -0
- package/lib/test/errorLogging.spec.js.map +1 -0
- package/lib/test/errorTypeLoggingTest.spec.js +107 -0
- package/lib/test/errorTypeLoggingTest.spec.js.map +1 -0
- package/lib/test/mockLogger.spec.js +164 -0
- package/lib/test/mockLogger.spec.js.map +1 -0
- package/lib/test/multiSinkLogger.spec.js +84 -0
- package/lib/test/multiSinkLogger.spec.js.map +1 -0
- package/lib/test/performanceEvent.spec.js +86 -0
- package/lib/test/performanceEvent.spec.js.map +1 -0
- package/lib/test/sampledTelemetryHelper.spec.js +169 -0
- package/lib/test/sampledTelemetryHelper.spec.js.map +1 -0
- package/lib/test/telemetryLogger.spec.js +357 -0
- package/lib/test/telemetryLogger.spec.js.map +1 -0
- package/lib/test/thresholdCounter.spec.js +51 -0
- package/lib/test/thresholdCounter.spec.js.map +1 -0
- package/lib/test/types/validateTelemetryUtilsPrevious.generated.js +132 -0
- package/lib/test/types/validateTelemetryUtilsPrevious.generated.js.map +1 -0
- package/lib/test/utils.spec.js +284 -0
- package/lib/test/utils.spec.js.map +1 -0
- package/lib/thresholdCounter.d.ts +1 -1
- package/lib/thresholdCounter.d.ts.map +1 -1
- package/lib/thresholdCounter.js.map +1 -1
- package/lib/utils.d.ts +1 -20
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -24
- package/lib/utils.js.map +1 -1
- package/package.json +75 -26
- package/src/config.ts +2 -2
- package/src/error.ts +2 -2
- package/src/errorLogging.ts +27 -68
- package/src/eventEmitterWithErrorHandling.ts +1 -1
- package/src/events.ts +2 -4
- package/src/fluidErrorBase.ts +4 -3
- package/src/index.ts +12 -13
- package/src/logger.ts +12 -28
- package/src/mockLogger.ts +2 -2
- package/src/sampledTelemetryHelper.ts +10 -11
- package/src/thresholdCounter.ts +1 -1
- package/src/utils.ts +3 -36
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -3
- package/tsconfig.esnext.json +0 -7
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import assert from "node:assert";
|
|
6
|
+
import { TelemetryLogger, convertToBasePropertyType, } from "../logger.js";
|
|
7
|
+
class TestTelemetryLogger extends TelemetryLogger {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.events = [];
|
|
11
|
+
}
|
|
12
|
+
send(event) {
|
|
13
|
+
this.events.push(this.prepareEvent(event));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const allCases = [
|
|
17
|
+
{},
|
|
18
|
+
{ allProp: 1 },
|
|
19
|
+
{ allGetter: () => 1 },
|
|
20
|
+
{ allProp: 1, allGetter: () => 1 },
|
|
21
|
+
];
|
|
22
|
+
const errorCases = [
|
|
23
|
+
{},
|
|
24
|
+
{ errorProp: 2 },
|
|
25
|
+
{ errorGetter: () => 2 },
|
|
26
|
+
{ errorProp: 2, errorGetter: () => 2 },
|
|
27
|
+
];
|
|
28
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
29
|
+
const propertyCases = allCases.reduce((pv, all) => {
|
|
30
|
+
pv.push(...errorCases.map((error) => ({ all, error })));
|
|
31
|
+
return pv;
|
|
32
|
+
}, []);
|
|
33
|
+
propertyCases.push(...allCases.map((all) => ({ all, error: all })), ...allCases, ...errorCases, undefined);
|
|
34
|
+
describe("TelemetryLogger", () => {
|
|
35
|
+
describe("Properties", () => {
|
|
36
|
+
it("send", () => {
|
|
37
|
+
for (const props of propertyCases) {
|
|
38
|
+
const logger = new TestTelemetryLogger("namespace", props);
|
|
39
|
+
logger.send({ category: "anything", eventName: "whatever" });
|
|
40
|
+
assert.strictEqual(logger.events.length, 1);
|
|
41
|
+
const event = logger.events[0];
|
|
42
|
+
assert.strictEqual(event.category, "anything");
|
|
43
|
+
assert.strictEqual(event.eventName, "namespace:whatever");
|
|
44
|
+
const eventKeys = Object.keys(event);
|
|
45
|
+
const propsKeys = Object.keys(props?.all ?? {});
|
|
46
|
+
// +2 for category and event name
|
|
47
|
+
assert.strictEqual(eventKeys.length, propsKeys.length + 2, `actual:\n${JSON.stringify(event)}\nexpected:${props ? JSON.stringify(props) : "undefined"}`);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
it("sendErrorEvent", () => {
|
|
51
|
+
for (const props of propertyCases) {
|
|
52
|
+
const logger = new TestTelemetryLogger("namespace", props);
|
|
53
|
+
logger.sendErrorEvent({ eventName: "whatever" });
|
|
54
|
+
assert.strictEqual(logger.events.length, 1);
|
|
55
|
+
const event = logger.events[0];
|
|
56
|
+
assert.strictEqual(event.category, "error");
|
|
57
|
+
assert.strictEqual(event.eventName, "namespace:whatever");
|
|
58
|
+
const eventKeys = Object.keys(event);
|
|
59
|
+
// should include error props too
|
|
60
|
+
const expected = { error: "whatever", ...props?.all, ...props?.error };
|
|
61
|
+
const propsKeys = Object.keys(expected);
|
|
62
|
+
for (const k of propsKeys) {
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
|
64
|
+
const e = typeof expected[k] === "function" ? expected[k]() : expected[k];
|
|
65
|
+
assert.strictEqual(event[k], e, `${k} value does not match.
|
|
66
|
+
actual: ${JSON.stringify(event[k])} expected: ${JSON.stringify(e)}`);
|
|
67
|
+
}
|
|
68
|
+
// +2 for category and event name
|
|
69
|
+
assert.strictEqual(eventKeys.length, propsKeys.length + 2, `actual:\n${JSON.stringify(event)}\nexpected:${props ? JSON.stringify(props) : "undefined"}`);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
it("sendErrorEvent with error field", () => {
|
|
73
|
+
for (const props of propertyCases) {
|
|
74
|
+
const logger = new TestTelemetryLogger("namespace", props);
|
|
75
|
+
logger.sendErrorEvent({ eventName: "whatever", error: "bad" });
|
|
76
|
+
assert.strictEqual(logger.events.length, 1);
|
|
77
|
+
const event = logger.events[0];
|
|
78
|
+
assert.strictEqual(event.category, "error");
|
|
79
|
+
assert.strictEqual(event.eventName, "namespace:whatever");
|
|
80
|
+
const eventKeys = Object.keys(event);
|
|
81
|
+
// should include error props too
|
|
82
|
+
const expected = { error: "bad", ...props?.all, ...props?.error };
|
|
83
|
+
const propsKeys = Object.keys(expected);
|
|
84
|
+
for (const k of propsKeys) {
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
|
86
|
+
const e = typeof expected[k] === "function" ? expected[k]() : expected[k];
|
|
87
|
+
assert.strictEqual(event[k], e, `${k} value does not match.
|
|
88
|
+
actual: ${JSON.stringify(event[k])} expected: ${JSON.stringify(e)}`);
|
|
89
|
+
}
|
|
90
|
+
// +2 for category and event name
|
|
91
|
+
assert.strictEqual(eventKeys.length, propsKeys.length + 2, `actual:\n${JSON.stringify(event)}\nexpected:${props ? JSON.stringify(props) : "undefined"}`);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
it("sendErrorEvent with error object", () => {
|
|
95
|
+
for (const props of propertyCases) {
|
|
96
|
+
const logger = new TestTelemetryLogger("namespace", props);
|
|
97
|
+
const error = new Error("badMessage");
|
|
98
|
+
logger.sendErrorEvent({ eventName: "whatever" }, error);
|
|
99
|
+
assert.strictEqual(logger.events.length, 1);
|
|
100
|
+
const event = logger.events[0];
|
|
101
|
+
assert.strictEqual(event.category, "error");
|
|
102
|
+
assert.strictEqual(event.eventName, "namespace:whatever");
|
|
103
|
+
const eventKeys = Object.keys(event);
|
|
104
|
+
// should include error props too
|
|
105
|
+
const expected = {
|
|
106
|
+
error: error.message,
|
|
107
|
+
...props?.all,
|
|
108
|
+
...props?.error,
|
|
109
|
+
};
|
|
110
|
+
const propsKeys = Object.keys(expected);
|
|
111
|
+
for (const k of propsKeys) {
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
|
113
|
+
const e = typeof expected[k] === "function" ? expected[k]() : expected[k];
|
|
114
|
+
assert.strictEqual(event[k], e, `${k} value does not match.
|
|
115
|
+
actual: ${JSON.stringify(event[k])} expected: ${JSON.stringify(e)}`);
|
|
116
|
+
}
|
|
117
|
+
// +4 for category, event name, message and stack
|
|
118
|
+
assert.strictEqual(eventKeys.length, propsKeys.length + 4, `actual:\n${JSON.stringify(event)}\nexpected:${props ? JSON.stringify(props) : "undefined"}`);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
it("sendTelemetryEvent", () => {
|
|
122
|
+
for (const props of propertyCases) {
|
|
123
|
+
const logger = new TestTelemetryLogger("namespace", props);
|
|
124
|
+
logger.sendTelemetryEvent({ eventName: "whatever" });
|
|
125
|
+
assert.strictEqual(logger.events.length, 1);
|
|
126
|
+
const event = logger.events[0];
|
|
127
|
+
assert.strictEqual(event.category, "generic");
|
|
128
|
+
assert.strictEqual(event.eventName, "namespace:whatever");
|
|
129
|
+
const eventKeys = Object.keys(event);
|
|
130
|
+
const propsKeys = Object.keys(props?.all ?? {});
|
|
131
|
+
// +2 for category and event name
|
|
132
|
+
assert.strictEqual(eventKeys.length, propsKeys.length + 2, `actual:\n${JSON.stringify(event)}\nexpected:${props ? JSON.stringify(props) : "undefined"}`);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
describe("convertToBasePropertyType", () => {
|
|
138
|
+
describe("tagged properties", () => {
|
|
139
|
+
it("tagged number", () => {
|
|
140
|
+
const taggedProperty = {
|
|
141
|
+
value: 123,
|
|
142
|
+
tag: "tag",
|
|
143
|
+
};
|
|
144
|
+
const converted = convertToBasePropertyType(taggedProperty);
|
|
145
|
+
const expected = {
|
|
146
|
+
value: 123,
|
|
147
|
+
tag: "tag",
|
|
148
|
+
};
|
|
149
|
+
assert.deepStrictEqual(converted, expected);
|
|
150
|
+
});
|
|
151
|
+
it("tagged string", () => {
|
|
152
|
+
const taggedProperty = {
|
|
153
|
+
value: "test",
|
|
154
|
+
tag: "tag",
|
|
155
|
+
};
|
|
156
|
+
const converted = convertToBasePropertyType(taggedProperty);
|
|
157
|
+
const expected = {
|
|
158
|
+
value: "test",
|
|
159
|
+
tag: "tag",
|
|
160
|
+
};
|
|
161
|
+
assert.deepStrictEqual(converted, expected);
|
|
162
|
+
});
|
|
163
|
+
it("tagged boolean", () => {
|
|
164
|
+
const taggedProperty = {
|
|
165
|
+
value: true,
|
|
166
|
+
tag: "tag",
|
|
167
|
+
};
|
|
168
|
+
const converted = convertToBasePropertyType(taggedProperty);
|
|
169
|
+
const expected = {
|
|
170
|
+
value: true,
|
|
171
|
+
tag: "tag",
|
|
172
|
+
};
|
|
173
|
+
assert.deepStrictEqual(converted, expected);
|
|
174
|
+
});
|
|
175
|
+
it("tagged array", () => {
|
|
176
|
+
const taggedProperty = {
|
|
177
|
+
value: [true, "test"],
|
|
178
|
+
tag: "tag",
|
|
179
|
+
};
|
|
180
|
+
const converted = convertToBasePropertyType(taggedProperty);
|
|
181
|
+
const expected = {
|
|
182
|
+
value: JSON.stringify([true, "test"]),
|
|
183
|
+
tag: "tag",
|
|
184
|
+
};
|
|
185
|
+
assert.deepStrictEqual(converted, expected);
|
|
186
|
+
});
|
|
187
|
+
it("tagged flat object", () => {
|
|
188
|
+
const value = {
|
|
189
|
+
a: 1,
|
|
190
|
+
b: "two",
|
|
191
|
+
c: true,
|
|
192
|
+
d: [false, "okay"],
|
|
193
|
+
};
|
|
194
|
+
const taggedProperty = {
|
|
195
|
+
value,
|
|
196
|
+
tag: "tag",
|
|
197
|
+
};
|
|
198
|
+
const converted = convertToBasePropertyType(taggedProperty);
|
|
199
|
+
const expected = {
|
|
200
|
+
value: JSON.stringify(value),
|
|
201
|
+
tag: "tag",
|
|
202
|
+
};
|
|
203
|
+
assert.deepStrictEqual(converted, expected);
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
describe("untagged properties", () => {
|
|
207
|
+
it("number", () => {
|
|
208
|
+
const property = 123;
|
|
209
|
+
const converted = convertToBasePropertyType(property);
|
|
210
|
+
const expected = 123;
|
|
211
|
+
assert.deepStrictEqual(converted, expected);
|
|
212
|
+
});
|
|
213
|
+
it("string", () => {
|
|
214
|
+
const property = "test";
|
|
215
|
+
const converted = convertToBasePropertyType(property);
|
|
216
|
+
const expected = "test";
|
|
217
|
+
assert.deepStrictEqual(converted, expected);
|
|
218
|
+
});
|
|
219
|
+
it("boolean", () => {
|
|
220
|
+
const property = true;
|
|
221
|
+
const converted = convertToBasePropertyType(property);
|
|
222
|
+
const expected = true;
|
|
223
|
+
assert.deepStrictEqual(converted, expected);
|
|
224
|
+
});
|
|
225
|
+
it("undefined", () => {
|
|
226
|
+
const property = undefined;
|
|
227
|
+
const converted = convertToBasePropertyType(property);
|
|
228
|
+
const expected = undefined;
|
|
229
|
+
assert.deepStrictEqual(converted, expected);
|
|
230
|
+
});
|
|
231
|
+
it("array", () => {
|
|
232
|
+
const property = [true, "test"];
|
|
233
|
+
const converted = convertToBasePropertyType(property);
|
|
234
|
+
const expected = JSON.stringify([true, "test"]);
|
|
235
|
+
assert.deepStrictEqual(converted, expected);
|
|
236
|
+
});
|
|
237
|
+
it("flat object", () => {
|
|
238
|
+
const property = {
|
|
239
|
+
a: 1,
|
|
240
|
+
b: "two",
|
|
241
|
+
c: true,
|
|
242
|
+
d: [false, "okay"],
|
|
243
|
+
e: undefined,
|
|
244
|
+
};
|
|
245
|
+
const converted = convertToBasePropertyType(property);
|
|
246
|
+
const expected = JSON.stringify(property);
|
|
247
|
+
assert.deepStrictEqual(converted, expected);
|
|
248
|
+
});
|
|
249
|
+
it("flat object with only undefined", () => {
|
|
250
|
+
const property = {
|
|
251
|
+
e: undefined,
|
|
252
|
+
};
|
|
253
|
+
const converted = convertToBasePropertyType(property);
|
|
254
|
+
const expected = "{}";
|
|
255
|
+
assert.deepStrictEqual(converted, expected);
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
// Note the "as any" required in each of these cases.
|
|
259
|
+
// These are unexpected, but it's good to have coverage to ensure they behave "well enough"
|
|
260
|
+
// (e.g. they shouldn't crash)
|
|
261
|
+
describe("Check various invalid (per typings) cases", () => {
|
|
262
|
+
it("nested ITaggedTelemetryPropertyTypeExt", () => {
|
|
263
|
+
const taggedProperty = {
|
|
264
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
265
|
+
value: { value: true, tag: "tag" },
|
|
266
|
+
tag: "tag",
|
|
267
|
+
};
|
|
268
|
+
const converted = convertToBasePropertyType(taggedProperty);
|
|
269
|
+
const expected = {
|
|
270
|
+
value: '{"value":true,"tag":"tag"}',
|
|
271
|
+
tag: "tag",
|
|
272
|
+
};
|
|
273
|
+
assert.deepStrictEqual(converted, expected);
|
|
274
|
+
});
|
|
275
|
+
it("nested non ITaggedTelemetryPropertyTypeExt", () => {
|
|
276
|
+
const taggedProperty = {
|
|
277
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
278
|
+
value: { foo: 3, bar: { x: 5 } },
|
|
279
|
+
tag: "tag",
|
|
280
|
+
};
|
|
281
|
+
const converted = convertToBasePropertyType(taggedProperty);
|
|
282
|
+
const expected = {
|
|
283
|
+
value: '{"foo":3,"bar":{"x":5}}',
|
|
284
|
+
tag: "tag",
|
|
285
|
+
};
|
|
286
|
+
assert.deepStrictEqual(converted, expected);
|
|
287
|
+
});
|
|
288
|
+
it("tagged function", () => {
|
|
289
|
+
const taggedProperty = {
|
|
290
|
+
value: function x() {
|
|
291
|
+
return 54;
|
|
292
|
+
},
|
|
293
|
+
tag: "tag",
|
|
294
|
+
};
|
|
295
|
+
const converted = convertToBasePropertyType(taggedProperty);
|
|
296
|
+
const expected = {
|
|
297
|
+
value: "INVALID PROPERTY (typed as function)",
|
|
298
|
+
tag: "tag",
|
|
299
|
+
};
|
|
300
|
+
assert.deepStrictEqual(converted, expected);
|
|
301
|
+
});
|
|
302
|
+
it("tagged null value", () => {
|
|
303
|
+
const taggedProperty = {
|
|
304
|
+
// eslint-disable-next-line unicorn/no-null
|
|
305
|
+
value: null,
|
|
306
|
+
tag: "tag",
|
|
307
|
+
};
|
|
308
|
+
const converted = convertToBasePropertyType(taggedProperty);
|
|
309
|
+
const expected = {
|
|
310
|
+
value: "null",
|
|
311
|
+
tag: "tag",
|
|
312
|
+
};
|
|
313
|
+
assert.deepStrictEqual(converted, expected);
|
|
314
|
+
});
|
|
315
|
+
it("tagged symbol", () => {
|
|
316
|
+
const taggedProperty = {
|
|
317
|
+
value: Symbol("Test"),
|
|
318
|
+
tag: "tag",
|
|
319
|
+
};
|
|
320
|
+
const converted = convertToBasePropertyType(taggedProperty);
|
|
321
|
+
const expected = {
|
|
322
|
+
value: "INVALID PROPERTY (typed as symbol)",
|
|
323
|
+
tag: "tag",
|
|
324
|
+
};
|
|
325
|
+
assert.deepStrictEqual(converted, expected);
|
|
326
|
+
});
|
|
327
|
+
it("nested object", () => {
|
|
328
|
+
const nestedObject = {
|
|
329
|
+
foo: { foo: true, test: "test" },
|
|
330
|
+
test: "test",
|
|
331
|
+
};
|
|
332
|
+
const converted = convertToBasePropertyType(nestedObject);
|
|
333
|
+
const expected = '{"foo":{"foo":true,"test":"test"},"test":"test"}';
|
|
334
|
+
assert.deepStrictEqual(converted, expected);
|
|
335
|
+
});
|
|
336
|
+
it("function", () => {
|
|
337
|
+
const converted = convertToBasePropertyType(function x() {
|
|
338
|
+
return 54;
|
|
339
|
+
});
|
|
340
|
+
const expected = "INVALID PROPERTY (typed as function)";
|
|
341
|
+
assert.deepStrictEqual(converted, expected);
|
|
342
|
+
});
|
|
343
|
+
it("null", () => {
|
|
344
|
+
const converted = convertToBasePropertyType(
|
|
345
|
+
// eslint-disable-next-line unicorn/no-null
|
|
346
|
+
null);
|
|
347
|
+
const expected = "null";
|
|
348
|
+
assert.deepStrictEqual(converted, expected);
|
|
349
|
+
});
|
|
350
|
+
it("symbol", () => {
|
|
351
|
+
const converted = convertToBasePropertyType(Symbol("Test"));
|
|
352
|
+
const expected = "INVALID PROPERTY (typed as symbol)";
|
|
353
|
+
assert.deepStrictEqual(converted, expected);
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
//# sourceMappingURL=telemetryLogger.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetryLogger.spec.js","sourceRoot":"","sources":["../../src/test/telemetryLogger.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAGN,eAAe,EACf,yBAAyB,GACzB,MAAM,cAAc,CAAC;AAMtB,MAAM,mBAAoB,SAAQ,eAAe;IAAjD;;QACQ,WAAM,GAA0B,EAAE,CAAC;IAI3C,CAAC;IAHO,IAAI,CAAC,KAA0B;QACrC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5C,CAAC;CACD;AAED,MAAM,QAAQ,GAAkC;IAC/C,EAAE;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AC,CAAC;YACjF,MAAM,QAAQ,GAAG,sCAAsC,CAAC;YACxD,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACf,MAAM,SAAS,GAAG,yBAAyB;YAC1C,2CAA2C;YAC3C,IAAkF,CAClF,CAAC;YACF,MAAM,QAAQ,GAAG,MAAM,CAAC;YACxB,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;YACjB,MAAM,SAAS,GAAG,yBAAyB,CAC1C,MAAM,CAAC,MAAM,CAEqB,CAClC,CAAC;YACF,MAAM,QAAQ,GAAG,oCAAoC,CAAC;YACtD,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport assert from \"node:assert\";\nimport { ITelemetryBaseEvent } from \"@fluidframework/core-interfaces\";\nimport {\n\tITelemetryLoggerPropertyBags,\n\tITelemetryLoggerPropertyBag,\n\tTelemetryLogger,\n\tconvertToBasePropertyType,\n} from \"../logger.js\";\nimport {\n\tITaggedTelemetryPropertyTypeExt,\n\tTelemetryEventPropertyTypeExt,\n} from \"../telemetryTypes.js\";\n\nclass TestTelemetryLogger extends TelemetryLogger {\n\tpublic events: ITelemetryBaseEvent[] = [];\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\tthis.events.push(this.prepareEvent(event));\n\t}\n}\n\nconst allCases: ITelemetryLoggerPropertyBag[] = [\n\t{},\n\t{ allProp: 1 },\n\t{ allGetter: (): number => 1 },\n\t{ allProp: 1, allGetter: (): number => 1 },\n];\nconst errorCases: ITelemetryLoggerPropertyBag[] = [\n\t{},\n\t{ errorProp: 2 },\n\t{ errorGetter: (): number => 2 },\n\t{ errorProp: 2, errorGetter: (): number => 2 },\n];\n\n// eslint-disable-next-line unicorn/no-array-reduce\nconst propertyCases: (ITelemetryLoggerPropertyBags | undefined)[] = allCases.reduce<\n\tITelemetryLoggerPropertyBags[]\n>((pv, all) => {\n\tpv.push(...errorCases.map((error) => ({ all, error })));\n\treturn pv;\n}, []);\npropertyCases.push(\n\t...allCases.map((all) => ({ all, error: all })),\n\t...allCases,\n\t...errorCases,\n\tundefined,\n);\n\ndescribe(\"TelemetryLogger\", () => {\n\tdescribe(\"Properties\", () => {\n\t\tit(\"send\", () => {\n\t\t\tfor (const props of propertyCases) {\n\t\t\t\tconst logger = new TestTelemetryLogger(\"namespace\", props);\n\t\t\t\tlogger.send({ category: \"anything\", eventName: \"whatever\" });\n\t\t\t\tassert.strictEqual(logger.events.length, 1);\n\t\t\t\tconst event = logger.events[0];\n\t\t\t\tassert.strictEqual(event.category, \"anything\");\n\t\t\t\tassert.strictEqual(event.eventName, \"namespace:whatever\");\n\t\t\t\tconst eventKeys = Object.keys(event);\n\t\t\t\tconst propsKeys = Object.keys(props?.all ?? {});\n\t\t\t\t// +2 for category and event name\n\t\t\t\tassert.strictEqual(\n\t\t\t\t\teventKeys.length,\n\t\t\t\t\tpropsKeys.length + 2,\n\t\t\t\t\t`actual:\\n${JSON.stringify(event)}\\nexpected:${\n\t\t\t\t\t\tprops ? JSON.stringify(props) : \"undefined\"\n\t\t\t\t\t}`,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tit(\"sendErrorEvent\", () => {\n\t\t\tfor (const props of propertyCases) {\n\t\t\t\tconst logger = new TestTelemetryLogger(\"namespace\", props);\n\t\t\t\tlogger.sendErrorEvent({ eventName: \"whatever\" });\n\t\t\t\tassert.strictEqual(logger.events.length, 1);\n\t\t\t\tconst event = logger.events[0];\n\t\t\t\tassert.strictEqual(event.category, \"error\");\n\t\t\t\tassert.strictEqual(event.eventName, \"namespace:whatever\");\n\t\t\t\tconst eventKeys = Object.keys(event);\n\t\t\t\t// should include error props too\n\t\t\t\tconst expected = { error: \"whatever\", ...props?.all, ...props?.error };\n\t\t\t\tconst propsKeys = Object.keys(expected);\n\t\t\t\tfor (const k of propsKeys) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n\t\t\t\t\tconst e = typeof expected[k] === \"function\" ? expected[k]() : expected[k];\n\t\t\t\t\tassert.strictEqual(\n\t\t\t\t\t\tevent[k],\n\t\t\t\t\t\te,\n\t\t\t\t\t\t`${k} value does not match.\n actual: ${JSON.stringify(event[k])} expected: ${JSON.stringify(e)}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// +2 for category and event name\n\t\t\t\tassert.strictEqual(\n\t\t\t\t\teventKeys.length,\n\t\t\t\t\tpropsKeys.length + 2,\n\t\t\t\t\t`actual:\\n${JSON.stringify(event)}\\nexpected:${\n\t\t\t\t\t\tprops ? JSON.stringify(props) : \"undefined\"\n\t\t\t\t\t}`,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tit(\"sendErrorEvent with error field\", () => {\n\t\t\tfor (const props of propertyCases) {\n\t\t\t\tconst logger = new TestTelemetryLogger(\"namespace\", props);\n\t\t\t\tlogger.sendErrorEvent({ eventName: \"whatever\", error: \"bad\" });\n\t\t\t\tassert.strictEqual(logger.events.length, 1);\n\t\t\t\tconst event = logger.events[0];\n\t\t\t\tassert.strictEqual(event.category, \"error\");\n\t\t\t\tassert.strictEqual(event.eventName, \"namespace:whatever\");\n\t\t\t\tconst eventKeys = Object.keys(event);\n\t\t\t\t// should include error props too\n\t\t\t\tconst expected = { error: \"bad\", ...props?.all, ...props?.error };\n\t\t\t\tconst propsKeys = Object.keys(expected);\n\t\t\t\tfor (const k of propsKeys) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n\t\t\t\t\tconst e = typeof expected[k] === \"function\" ? expected[k]() : expected[k];\n\t\t\t\t\tassert.strictEqual(\n\t\t\t\t\t\tevent[k],\n\t\t\t\t\t\te,\n\t\t\t\t\t\t`${k} value does not match.\n actual: ${JSON.stringify(event[k])} expected: ${JSON.stringify(e)}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// +2 for category and event name\n\t\t\t\tassert.strictEqual(\n\t\t\t\t\teventKeys.length,\n\t\t\t\t\tpropsKeys.length + 2,\n\t\t\t\t\t`actual:\\n${JSON.stringify(event)}\\nexpected:${\n\t\t\t\t\t\tprops ? JSON.stringify(props) : \"undefined\"\n\t\t\t\t\t}`,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tit(\"sendErrorEvent with error object\", () => {\n\t\t\tfor (const props of propertyCases) {\n\t\t\t\tconst logger = new TestTelemetryLogger(\"namespace\", props);\n\t\t\t\tconst error = new Error(\"badMessage\");\n\t\t\t\tlogger.sendErrorEvent({ eventName: \"whatever\" }, error);\n\t\t\t\tassert.strictEqual(logger.events.length, 1);\n\t\t\t\tconst event = logger.events[0];\n\t\t\t\tassert.strictEqual(event.category, \"error\");\n\t\t\t\tassert.strictEqual(event.eventName, \"namespace:whatever\");\n\t\t\t\tconst eventKeys = Object.keys(event);\n\t\t\t\t// should include error props too\n\t\t\t\tconst expected = {\n\t\t\t\t\terror: error.message,\n\t\t\t\t\t...props?.all,\n\t\t\t\t\t...props?.error,\n\t\t\t\t};\n\t\t\t\tconst propsKeys = Object.keys(expected);\n\t\t\t\tfor (const k of propsKeys) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n\t\t\t\t\tconst e = typeof expected[k] === \"function\" ? expected[k]() : expected[k];\n\t\t\t\t\tassert.strictEqual(\n\t\t\t\t\t\tevent[k],\n\t\t\t\t\t\te,\n\t\t\t\t\t\t`${k} value does not match.\n actual: ${JSON.stringify(event[k])} expected: ${JSON.stringify(e)}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// +4 for category, event name, message and stack\n\t\t\t\tassert.strictEqual(\n\t\t\t\t\teventKeys.length,\n\t\t\t\t\tpropsKeys.length + 4,\n\t\t\t\t\t`actual:\\n${JSON.stringify(event)}\\nexpected:${\n\t\t\t\t\t\tprops ? JSON.stringify(props) : \"undefined\"\n\t\t\t\t\t}`,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tit(\"sendTelemetryEvent\", () => {\n\t\t\tfor (const props of propertyCases) {\n\t\t\t\tconst logger = new TestTelemetryLogger(\"namespace\", props);\n\t\t\t\tlogger.sendTelemetryEvent({ eventName: \"whatever\" });\n\t\t\t\tassert.strictEqual(logger.events.length, 1);\n\t\t\t\tconst event = logger.events[0];\n\t\t\t\tassert.strictEqual(event.category, \"generic\");\n\t\t\t\tassert.strictEqual(event.eventName, \"namespace:whatever\");\n\t\t\t\tconst eventKeys = Object.keys(event);\n\t\t\t\tconst propsKeys = Object.keys(props?.all ?? {});\n\t\t\t\t// +2 for category and event name\n\t\t\t\tassert.strictEqual(\n\t\t\t\t\teventKeys.length,\n\t\t\t\t\tpropsKeys.length + 2,\n\t\t\t\t\t`actual:\\n${JSON.stringify(event)}\\nexpected:${\n\t\t\t\t\t\tprops ? JSON.stringify(props) : \"undefined\"\n\t\t\t\t\t}`,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t});\n});\n\ndescribe(\"convertToBasePropertyType\", () => {\n\tdescribe(\"tagged properties\", () => {\n\t\tit(\"tagged number\", () => {\n\t\t\tconst taggedProperty: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: 123,\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(taggedProperty);\n\t\t\tconst expected: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: 123,\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"tagged string\", () => {\n\t\t\tconst taggedProperty: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: \"test\",\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(taggedProperty);\n\t\t\tconst expected: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: \"test\",\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"tagged boolean\", () => {\n\t\t\tconst taggedProperty: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: true,\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(taggedProperty);\n\t\t\tconst expected: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: true,\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"tagged array\", () => {\n\t\t\tconst taggedProperty: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: [true, \"test\"],\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(taggedProperty);\n\t\t\tconst expected: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: JSON.stringify([true, \"test\"]),\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"tagged flat object\", () => {\n\t\t\tconst value: TelemetryEventPropertyTypeExt = {\n\t\t\t\ta: 1,\n\t\t\t\tb: \"two\",\n\t\t\t\tc: true,\n\t\t\t\td: [false, \"okay\"],\n\t\t\t};\n\t\t\tconst taggedProperty: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue,\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(taggedProperty);\n\t\t\tconst expected: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: JSON.stringify(value),\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t});\n\tdescribe(\"untagged properties\", () => {\n\t\tit(\"number\", () => {\n\t\t\tconst property: TelemetryEventPropertyTypeExt = 123;\n\t\t\tconst converted = convertToBasePropertyType(property);\n\t\t\tconst expected: TelemetryEventPropertyTypeExt = 123;\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"string\", () => {\n\t\t\tconst property: TelemetryEventPropertyTypeExt = \"test\";\n\t\t\tconst converted = convertToBasePropertyType(property);\n\t\t\tconst expected: TelemetryEventPropertyTypeExt = \"test\";\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"boolean\", () => {\n\t\t\tconst property: TelemetryEventPropertyTypeExt = true;\n\t\t\tconst converted = convertToBasePropertyType(property);\n\t\t\tconst expected: TelemetryEventPropertyTypeExt = true;\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"undefined\", () => {\n\t\t\tconst property: TelemetryEventPropertyTypeExt = undefined;\n\t\t\tconst converted = convertToBasePropertyType(property);\n\t\t\tconst expected: TelemetryEventPropertyTypeExt = undefined;\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"array\", () => {\n\t\t\tconst property: TelemetryEventPropertyTypeExt = [true, \"test\"];\n\t\t\tconst converted = convertToBasePropertyType(property);\n\t\t\tconst expected: TelemetryEventPropertyTypeExt = JSON.stringify([true, \"test\"]);\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"flat object\", () => {\n\t\t\tconst property: TelemetryEventPropertyTypeExt = {\n\t\t\t\ta: 1,\n\t\t\t\tb: \"two\",\n\t\t\t\tc: true,\n\t\t\t\td: [false, \"okay\"],\n\t\t\t\te: undefined,\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(property);\n\t\t\tconst expected: TelemetryEventPropertyTypeExt = JSON.stringify(property);\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"flat object with only undefined\", () => {\n\t\t\tconst property: TelemetryEventPropertyTypeExt = {\n\t\t\t\te: undefined,\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(property);\n\t\t\tconst expected: TelemetryEventPropertyTypeExt = \"{}\";\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t});\n\t// Note the \"as any\" required in each of these cases.\n\t// These are unexpected, but it's good to have coverage to ensure they behave \"well enough\"\n\t// (e.g. they shouldn't crash)\n\tdescribe(\"Check various invalid (per typings) cases\", () => {\n\t\tit(\"nested ITaggedTelemetryPropertyTypeExt\", () => {\n\t\t\tconst taggedProperty: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t\t\tvalue: { value: true, tag: \"tag\" } as TelemetryEventPropertyTypeExt,\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(taggedProperty);\n\t\t\tconst expected: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: '{\"value\":true,\"tag\":\"tag\"}',\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"nested non ITaggedTelemetryPropertyTypeExt\", () => {\n\t\t\tconst taggedProperty: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t\t\tvalue: { foo: 3, bar: { x: 5 } as unknown } as TelemetryEventPropertyTypeExt,\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(taggedProperty);\n\t\t\tconst expected: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: '{\"foo\":3,\"bar\":{\"x\":5}}',\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"tagged function\", () => {\n\t\t\tconst taggedProperty: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: function x() {\n\t\t\t\t\treturn 54;\n\t\t\t\t} as unknown as TelemetryEventPropertyTypeExt,\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(taggedProperty);\n\t\t\tconst expected: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: \"INVALID PROPERTY (typed as function)\",\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"tagged null value\", () => {\n\t\t\tconst taggedProperty: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\t// eslint-disable-next-line unicorn/no-null\n\t\t\t\tvalue: null as unknown as TelemetryEventPropertyTypeExt,\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(taggedProperty);\n\t\t\tconst expected: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: \"null\",\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"tagged symbol\", () => {\n\t\t\tconst taggedProperty: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: Symbol(\"Test\") as unknown as TelemetryEventPropertyTypeExt,\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(taggedProperty);\n\t\t\tconst expected: ITaggedTelemetryPropertyTypeExt = {\n\t\t\t\tvalue: \"INVALID PROPERTY (typed as symbol)\",\n\t\t\t\ttag: \"tag\",\n\t\t\t};\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"nested object\", () => {\n\t\t\tconst nestedObject = {\n\t\t\t\tfoo: { foo: true, test: \"test\" },\n\t\t\t\ttest: \"test\",\n\t\t\t};\n\t\t\tconst converted = convertToBasePropertyType(\n\t\t\t\tnestedObject as unknown as\n\t\t\t\t\t| TelemetryEventPropertyTypeExt\n\t\t\t\t\t| ITaggedTelemetryPropertyTypeExt,\n\t\t\t);\n\t\t\tconst expected = '{\"foo\":{\"foo\":true,\"test\":\"test\"},\"test\":\"test\"}';\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"function\", () => {\n\t\t\tconst converted = convertToBasePropertyType(function x() {\n\t\t\t\treturn 54;\n\t\t\t} as unknown as TelemetryEventPropertyTypeExt | ITaggedTelemetryPropertyTypeExt);\n\t\t\tconst expected = \"INVALID PROPERTY (typed as function)\";\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"null\", () => {\n\t\t\tconst converted = convertToBasePropertyType(\n\t\t\t\t// eslint-disable-next-line unicorn/no-null\n\t\t\t\tnull as unknown as TelemetryEventPropertyTypeExt | ITaggedTelemetryPropertyTypeExt,\n\t\t\t);\n\t\t\tconst expected = \"null\";\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t\tit(\"symbol\", () => {\n\t\t\tconst converted = convertToBasePropertyType(\n\t\t\t\tSymbol(\"Test\") as unknown as\n\t\t\t\t\t| TelemetryEventPropertyTypeExt\n\t\t\t\t\t| ITaggedTelemetryPropertyTypeExt,\n\t\t\t);\n\t\t\tconst expected = \"INVALID PROPERTY (typed as symbol)\";\n\t\t\tassert.deepStrictEqual(converted, expected);\n\t\t});\n\t});\n});\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import assert from "node:assert";
|
|
6
|
+
import { ThresholdCounter } from "../thresholdCounter.js";
|
|
7
|
+
class FakeTelemetryLogger {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.events = [];
|
|
10
|
+
}
|
|
11
|
+
send(_event) {
|
|
12
|
+
assert.fail("Should not be called");
|
|
13
|
+
}
|
|
14
|
+
sendTelemetryEvent(_event, _error) {
|
|
15
|
+
assert.fail("Should not be called");
|
|
16
|
+
}
|
|
17
|
+
sendErrorEvent(_event, _error) {
|
|
18
|
+
assert.fail("Should not be called");
|
|
19
|
+
}
|
|
20
|
+
sendPerformanceEvent(event, _error) {
|
|
21
|
+
this.events.push(event);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
describe("ThresholdCounter", () => {
|
|
25
|
+
let logger;
|
|
26
|
+
let sender;
|
|
27
|
+
const threshold = 100;
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
logger = new FakeTelemetryLogger();
|
|
30
|
+
sender = new ThresholdCounter(threshold, logger);
|
|
31
|
+
});
|
|
32
|
+
it("Send only if it passes threshold", () => {
|
|
33
|
+
sender.send("event_1", threshold);
|
|
34
|
+
sender.send("event_2", threshold + 1);
|
|
35
|
+
sender.send("event_3", threshold - 1);
|
|
36
|
+
sender.send("event_4", 0);
|
|
37
|
+
assert.strictEqual(logger.events.length, 2);
|
|
38
|
+
assert.deepStrictEqual(logger.events[0], { eventName: "event_1", value: threshold });
|
|
39
|
+
assert.deepStrictEqual(logger.events[1], { eventName: "event_2", value: threshold + 1 });
|
|
40
|
+
});
|
|
41
|
+
it("Send only if value is multiple", () => {
|
|
42
|
+
sender.sendIfMultiple("event_1", threshold);
|
|
43
|
+
sender.sendIfMultiple("event_2", threshold * 2);
|
|
44
|
+
sender.sendIfMultiple("event_3", threshold - 1);
|
|
45
|
+
sender.sendIfMultiple("event_4", 0);
|
|
46
|
+
assert.strictEqual(logger.events.length, 2);
|
|
47
|
+
assert.deepStrictEqual(logger.events[0], { eventName: "event_1", value: threshold });
|
|
48
|
+
assert.deepStrictEqual(logger.events[1], { eventName: "event_2", value: threshold * 2 });
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=thresholdCounter.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thresholdCounter.spec.js","sourceRoot":"","sources":["../../src/test/thresholdCounter.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAQ1D,MAAM,mBAAmB;IAAzB;QACQ,WAAM,GAAgC,EAAE,CAAC;IAiBjD,CAAC;IAfO,IAAI,CAAC,MAA2B;QACtC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACrC,CAAC;IAEM,kBAAkB,CAAC,MAAiC,EAAE,MAAgB;QAC5E,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACrC,CAAC;IAEM,cAAc,CAAC,MAA+B,EAAE,MAAgB;QACtE,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACrC,CAAC;IAEM,oBAAoB,CAAC,KAAoC,EAAE,MAAgB;QACjF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACD;AAED,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IACjC,IAAI,MAA2B,CAAC;IAChC,IAAI,MAAwB,CAAC;IAC7B,MAAM,SAAS,GAAG,GAAG,CAAC;IAEtB,UAAU,CAAC,GAAG,EAAE;QACf,MAAM,GAAG,IAAI,mBAAmB,EAAE,CAAC;QACnC,MAAM,GAAG,IAAI,gBAAgB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAClC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC;QAC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AC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport assert from \"node:assert\";\nimport { ITelemetryBaseEvent } from \"@fluidframework/core-interfaces\";\nimport { ThresholdCounter } from \"../thresholdCounter.js\";\nimport {\n\tITelemetryLoggerExt,\n\ttype ITelemetryGenericEventExt,\n\ttype ITelemetryErrorEventExt,\n\ttype ITelemetryPerformanceEventExt,\n} from \"../telemetryTypes.js\";\n\nclass FakeTelemetryLogger implements ITelemetryLoggerExt {\n\tpublic events: ITelemetryGenericEventExt[] = [];\n\n\tpublic send(_event: ITelemetryBaseEvent): void {\n\t\tassert.fail(\"Should not be called\");\n\t}\n\n\tpublic sendTelemetryEvent(_event: ITelemetryGenericEventExt, _error?: unknown): void {\n\t\tassert.fail(\"Should not be called\");\n\t}\n\n\tpublic sendErrorEvent(_event: ITelemetryErrorEventExt, _error?: unknown): void {\n\t\tassert.fail(\"Should not be called\");\n\t}\n\n\tpublic sendPerformanceEvent(event: ITelemetryPerformanceEventExt, _error?: unknown): void {\n\t\tthis.events.push(event);\n\t}\n}\n\ndescribe(\"ThresholdCounter\", () => {\n\tlet logger: FakeTelemetryLogger;\n\tlet sender: ThresholdCounter;\n\tconst threshold = 100;\n\n\tbeforeEach(() => {\n\t\tlogger = new FakeTelemetryLogger();\n\t\tsender = new ThresholdCounter(threshold, logger);\n\t});\n\n\tit(\"Send only if it passes threshold\", () => {\n\t\tsender.send(\"event_1\", threshold);\n\t\tsender.send(\"event_2\", threshold + 1);\n\t\tsender.send(\"event_3\", threshold - 1);\n\t\tsender.send(\"event_4\", 0);\n\n\t\tassert.strictEqual(logger.events.length, 2);\n\t\tassert.deepStrictEqual(logger.events[0], { eventName: \"event_1\", value: threshold });\n\t\tassert.deepStrictEqual(logger.events[1], { eventName: \"event_2\", value: threshold + 1 });\n\t});\n\n\tit(\"Send only if value is multiple\", () => {\n\t\tsender.sendIfMultiple(\"event_1\", threshold);\n\t\tsender.sendIfMultiple(\"event_2\", threshold * 2);\n\t\tsender.sendIfMultiple(\"event_3\", threshold - 1);\n\t\tsender.sendIfMultiple(\"event_4\", 0);\n\n\t\tassert.strictEqual(logger.events.length, 2);\n\t\tassert.deepStrictEqual(logger.events[0], { eventName: \"event_1\", value: threshold });\n\t\tassert.deepStrictEqual(logger.events[1], { eventName: \"event_2\", value: threshold * 2 });\n\t});\n});\n"]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
use_current_ClassDeclaration_DataCorruptionError(get_old_ClassDeclaration_DataCorruptionError());
|
|
2
|
+
use_old_ClassDeclaration_DataCorruptionError(get_current_ClassDeclaration_DataCorruptionError());
|
|
3
|
+
use_current_ClassDeclaration_DataProcessingError(get_old_ClassDeclaration_DataProcessingError());
|
|
4
|
+
use_old_ClassDeclaration_DataProcessingError(get_current_ClassDeclaration_DataProcessingError());
|
|
5
|
+
use_current_ClassDeclaration_EventEmitterWithErrorHandling(get_old_ClassDeclaration_EventEmitterWithErrorHandling());
|
|
6
|
+
use_old_ClassDeclaration_EventEmitterWithErrorHandling(get_current_ClassDeclaration_EventEmitterWithErrorHandling());
|
|
7
|
+
use_current_ClassDeclaration_GenericError(get_old_ClassDeclaration_GenericError());
|
|
8
|
+
use_old_ClassDeclaration_GenericError(get_current_ClassDeclaration_GenericError());
|
|
9
|
+
use_current_InterfaceDeclaration_IConfigProvider(get_old_InterfaceDeclaration_IConfigProvider());
|
|
10
|
+
use_old_InterfaceDeclaration_IConfigProvider(get_current_InterfaceDeclaration_IConfigProvider());
|
|
11
|
+
use_current_InterfaceDeclaration_IEventSampler(get_old_InterfaceDeclaration_IEventSampler());
|
|
12
|
+
use_old_InterfaceDeclaration_IEventSampler(get_current_InterfaceDeclaration_IEventSampler());
|
|
13
|
+
use_current_InterfaceDeclaration_IFluidErrorAnnotations(get_old_InterfaceDeclaration_IFluidErrorAnnotations());
|
|
14
|
+
use_old_InterfaceDeclaration_IFluidErrorAnnotations(get_current_InterfaceDeclaration_IFluidErrorAnnotations());
|
|
15
|
+
use_current_InterfaceDeclaration_IFluidErrorBase(get_old_InterfaceDeclaration_IFluidErrorBase());
|
|
16
|
+
use_old_InterfaceDeclaration_IFluidErrorBase(get_current_InterfaceDeclaration_IFluidErrorBase());
|
|
17
|
+
use_current_InterfaceDeclaration_IPerformanceEventMarkers(get_old_InterfaceDeclaration_IPerformanceEventMarkers());
|
|
18
|
+
use_old_InterfaceDeclaration_IPerformanceEventMarkers(get_current_InterfaceDeclaration_IPerformanceEventMarkers());
|
|
19
|
+
use_current_InterfaceDeclaration_ISampledTelemetryLogger(get_old_InterfaceDeclaration_ISampledTelemetryLogger());
|
|
20
|
+
use_old_InterfaceDeclaration_ISampledTelemetryLogger(get_current_InterfaceDeclaration_ISampledTelemetryLogger());
|
|
21
|
+
use_current_InterfaceDeclaration_ITaggedTelemetryPropertyTypeExt(get_old_InterfaceDeclaration_ITaggedTelemetryPropertyTypeExt());
|
|
22
|
+
use_old_InterfaceDeclaration_ITaggedTelemetryPropertyTypeExt(get_current_InterfaceDeclaration_ITaggedTelemetryPropertyTypeExt());
|
|
23
|
+
use_current_InterfaceDeclaration_ITelemetryErrorEventExt(get_old_InterfaceDeclaration_ITelemetryErrorEventExt());
|
|
24
|
+
use_old_InterfaceDeclaration_ITelemetryErrorEventExt(get_current_InterfaceDeclaration_ITelemetryErrorEventExt());
|
|
25
|
+
use_current_InterfaceDeclaration_ITelemetryEventExt(get_old_InterfaceDeclaration_ITelemetryEventExt());
|
|
26
|
+
use_old_InterfaceDeclaration_ITelemetryEventExt(get_current_InterfaceDeclaration_ITelemetryEventExt());
|
|
27
|
+
use_current_InterfaceDeclaration_ITelemetryGenericEventExt(get_old_InterfaceDeclaration_ITelemetryGenericEventExt());
|
|
28
|
+
use_old_InterfaceDeclaration_ITelemetryGenericEventExt(get_current_InterfaceDeclaration_ITelemetryGenericEventExt());
|
|
29
|
+
use_current_InterfaceDeclaration_ITelemetryLoggerExt(get_old_InterfaceDeclaration_ITelemetryLoggerExt());
|
|
30
|
+
use_old_InterfaceDeclaration_ITelemetryLoggerExt(get_current_InterfaceDeclaration_ITelemetryLoggerExt());
|
|
31
|
+
use_current_InterfaceDeclaration_ITelemetryLoggerPropertyBag(get_old_InterfaceDeclaration_ITelemetryLoggerPropertyBag());
|
|
32
|
+
use_old_InterfaceDeclaration_ITelemetryLoggerPropertyBag(get_current_InterfaceDeclaration_ITelemetryLoggerPropertyBag());
|
|
33
|
+
use_current_InterfaceDeclaration_ITelemetryLoggerPropertyBags(get_old_InterfaceDeclaration_ITelemetryLoggerPropertyBags());
|
|
34
|
+
use_old_InterfaceDeclaration_ITelemetryLoggerPropertyBags(get_current_InterfaceDeclaration_ITelemetryLoggerPropertyBags());
|
|
35
|
+
use_current_InterfaceDeclaration_ITelemetryPerformanceEventExt(get_old_InterfaceDeclaration_ITelemetryPerformanceEventExt());
|
|
36
|
+
use_old_InterfaceDeclaration_ITelemetryPerformanceEventExt(get_current_InterfaceDeclaration_ITelemetryPerformanceEventExt());
|
|
37
|
+
use_current_InterfaceDeclaration_ITelemetryPropertiesExt(get_old_InterfaceDeclaration_ITelemetryPropertiesExt());
|
|
38
|
+
use_old_InterfaceDeclaration_ITelemetryPropertiesExt(get_current_InterfaceDeclaration_ITelemetryPropertiesExt());
|
|
39
|
+
use_current_ClassDeclaration_LoggingError(get_old_ClassDeclaration_LoggingError());
|
|
40
|
+
use_old_ClassDeclaration_LoggingError(get_current_ClassDeclaration_LoggingError());
|
|
41
|
+
use_current_ClassDeclaration_MockLogger(get_old_ClassDeclaration_MockLogger());
|
|
42
|
+
use_old_ClassDeclaration_MockLogger(get_current_ClassDeclaration_MockLogger());
|
|
43
|
+
use_current_InterfaceDeclaration_MonitoringContext(get_old_InterfaceDeclaration_MonitoringContext());
|
|
44
|
+
use_old_InterfaceDeclaration_MonitoringContext(get_current_InterfaceDeclaration_MonitoringContext());
|
|
45
|
+
use_current_InterfaceDeclaration_MultiSinkLoggerProperties(get_old_InterfaceDeclaration_MultiSinkLoggerProperties());
|
|
46
|
+
use_old_InterfaceDeclaration_MultiSinkLoggerProperties(get_current_InterfaceDeclaration_MultiSinkLoggerProperties());
|
|
47
|
+
use_current_VariableDeclaration_NORMALIZED_ERROR_TYPE(get_old_VariableDeclaration_NORMALIZED_ERROR_TYPE());
|
|
48
|
+
use_old_VariableDeclaration_NORMALIZED_ERROR_TYPE(get_current_VariableDeclaration_NORMALIZED_ERROR_TYPE());
|
|
49
|
+
use_current_ClassDeclaration_PerformanceEvent(get_old_ClassDeclaration_PerformanceEvent());
|
|
50
|
+
use_old_ClassDeclaration_PerformanceEvent(get_current_ClassDeclaration_PerformanceEvent());
|
|
51
|
+
use_current_ClassDeclaration_SampledTelemetryHelper(get_old_ClassDeclaration_SampledTelemetryHelper());
|
|
52
|
+
use_old_ClassDeclaration_SampledTelemetryHelper(get_current_ClassDeclaration_SampledTelemetryHelper());
|
|
53
|
+
use_current_ClassDeclaration_TaggedLoggerAdapter(get_old_ClassDeclaration_TaggedLoggerAdapter());
|
|
54
|
+
use_old_ClassDeclaration_TaggedLoggerAdapter(get_current_ClassDeclaration_TaggedLoggerAdapter());
|
|
55
|
+
use_current_EnumDeclaration_TelemetryDataTag(get_old_EnumDeclaration_TelemetryDataTag());
|
|
56
|
+
use_old_EnumDeclaration_TelemetryDataTag(get_current_EnumDeclaration_TelemetryDataTag());
|
|
57
|
+
use_current_TypeAliasDeclaration_TelemetryEventCategory(get_old_TypeAliasDeclaration_TelemetryEventCategory());
|
|
58
|
+
use_old_TypeAliasDeclaration_TelemetryEventCategory(get_current_TypeAliasDeclaration_TelemetryEventCategory());
|
|
59
|
+
use_current_TypeAliasDeclaration_TelemetryEventPropertyTypeExt(get_old_TypeAliasDeclaration_TelemetryEventPropertyTypeExt());
|
|
60
|
+
use_old_TypeAliasDeclaration_TelemetryEventPropertyTypeExt(get_current_TypeAliasDeclaration_TelemetryEventPropertyTypeExt());
|
|
61
|
+
use_current_TypeAliasDeclaration_TelemetryEventPropertyTypes(get_old_TypeAliasDeclaration_TelemetryEventPropertyTypes());
|
|
62
|
+
use_old_TypeAliasDeclaration_TelemetryEventPropertyTypes(get_current_TypeAliasDeclaration_TelemetryEventPropertyTypes());
|
|
63
|
+
use_current_ClassDeclaration_ThresholdCounter(get_old_ClassDeclaration_ThresholdCounter());
|
|
64
|
+
use_old_ClassDeclaration_ThresholdCounter(get_current_ClassDeclaration_ThresholdCounter());
|
|
65
|
+
use_current_ClassDeclaration_UsageError(get_old_ClassDeclaration_UsageError());
|
|
66
|
+
use_old_ClassDeclaration_UsageError(get_current_ClassDeclaration_UsageError());
|
|
67
|
+
use_current_VariableDeclaration_connectedEventName(get_old_VariableDeclaration_connectedEventName());
|
|
68
|
+
use_old_VariableDeclaration_connectedEventName(get_current_VariableDeclaration_connectedEventName());
|
|
69
|
+
use_current_FunctionDeclaration_createChildLogger(get_old_FunctionDeclaration_createChildLogger());
|
|
70
|
+
use_old_FunctionDeclaration_createChildLogger(get_current_FunctionDeclaration_createChildLogger());
|
|
71
|
+
use_current_FunctionDeclaration_createChildMonitoringContext(get_old_FunctionDeclaration_createChildMonitoringContext());
|
|
72
|
+
use_old_FunctionDeclaration_createChildMonitoringContext(get_current_FunctionDeclaration_createChildMonitoringContext());
|
|
73
|
+
use_current_FunctionDeclaration_createMultiSinkLogger(get_old_FunctionDeclaration_createMultiSinkLogger());
|
|
74
|
+
use_old_FunctionDeclaration_createMultiSinkLogger(get_current_FunctionDeclaration_createMultiSinkLogger());
|
|
75
|
+
use_current_FunctionDeclaration_createSampledLogger(get_old_FunctionDeclaration_createSampledLogger());
|
|
76
|
+
use_old_FunctionDeclaration_createSampledLogger(get_current_FunctionDeclaration_createSampledLogger());
|
|
77
|
+
use_current_VariableDeclaration_disconnectedEventName(get_old_VariableDeclaration_disconnectedEventName());
|
|
78
|
+
use_old_VariableDeclaration_disconnectedEventName(get_current_VariableDeclaration_disconnectedEventName());
|
|
79
|
+
use_current_VariableDeclaration_eventNamespaceSeparator(get_old_VariableDeclaration_eventNamespaceSeparator());
|
|
80
|
+
use_old_VariableDeclaration_eventNamespaceSeparator(get_current_VariableDeclaration_eventNamespaceSeparator());
|
|
81
|
+
use_current_FunctionDeclaration_extractLogSafeErrorProperties(get_old_FunctionDeclaration_extractLogSafeErrorProperties());
|
|
82
|
+
use_old_FunctionDeclaration_extractLogSafeErrorProperties(get_current_FunctionDeclaration_extractLogSafeErrorProperties());
|
|
83
|
+
use_current_VariableDeclaration_extractSafePropertiesFromMessage(get_old_VariableDeclaration_extractSafePropertiesFromMessage());
|
|
84
|
+
use_old_VariableDeclaration_extractSafePropertiesFromMessage(get_current_VariableDeclaration_extractSafePropertiesFromMessage());
|
|
85
|
+
use_current_FunctionDeclaration_formatTick(get_old_FunctionDeclaration_formatTick());
|
|
86
|
+
use_old_FunctionDeclaration_formatTick(get_current_FunctionDeclaration_formatTick());
|
|
87
|
+
use_current_FunctionDeclaration_generateErrorWithStack(get_old_FunctionDeclaration_generateErrorWithStack());
|
|
88
|
+
use_old_FunctionDeclaration_generateErrorWithStack(get_current_FunctionDeclaration_generateErrorWithStack());
|
|
89
|
+
use_current_FunctionDeclaration_generateStack(get_old_FunctionDeclaration_generateStack());
|
|
90
|
+
use_old_FunctionDeclaration_generateStack(get_current_FunctionDeclaration_generateStack());
|
|
91
|
+
use_current_VariableDeclaration_getCircularReplacer(get_old_VariableDeclaration_getCircularReplacer());
|
|
92
|
+
use_old_VariableDeclaration_getCircularReplacer(get_current_VariableDeclaration_getCircularReplacer());
|
|
93
|
+
use_current_VariableDeclaration_hasErrorInstanceId(get_old_VariableDeclaration_hasErrorInstanceId());
|
|
94
|
+
use_old_VariableDeclaration_hasErrorInstanceId(get_current_VariableDeclaration_hasErrorInstanceId());
|
|
95
|
+
use_current_FunctionDeclaration_isExternalError(get_old_FunctionDeclaration_isExternalError());
|
|
96
|
+
use_old_FunctionDeclaration_isExternalError(get_current_FunctionDeclaration_isExternalError());
|
|
97
|
+
use_current_FunctionDeclaration_isFluidError(get_old_FunctionDeclaration_isFluidError());
|
|
98
|
+
use_old_FunctionDeclaration_isFluidError(get_current_FunctionDeclaration_isFluidError());
|
|
99
|
+
use_current_VariableDeclaration_isILoggingError(get_old_VariableDeclaration_isILoggingError());
|
|
100
|
+
use_old_VariableDeclaration_isILoggingError(get_current_VariableDeclaration_isILoggingError());
|
|
101
|
+
use_current_FunctionDeclaration_isTaggedTelemetryPropertyValue(get_old_FunctionDeclaration_isTaggedTelemetryPropertyValue());
|
|
102
|
+
use_old_FunctionDeclaration_isTaggedTelemetryPropertyValue(get_current_FunctionDeclaration_isTaggedTelemetryPropertyValue());
|
|
103
|
+
use_current_FunctionDeclaration_isValidLegacyError(get_old_FunctionDeclaration_isValidLegacyError());
|
|
104
|
+
use_old_FunctionDeclaration_isValidLegacyError(get_current_FunctionDeclaration_isValidLegacyError());
|
|
105
|
+
use_current_FunctionDeclaration_loggerToMonitoringContext(get_old_FunctionDeclaration_loggerToMonitoringContext());
|
|
106
|
+
use_old_FunctionDeclaration_loggerToMonitoringContext(get_current_FunctionDeclaration_loggerToMonitoringContext());
|
|
107
|
+
use_current_FunctionDeclaration_mixinMonitoringContext(get_old_FunctionDeclaration_mixinMonitoringContext());
|
|
108
|
+
use_old_FunctionDeclaration_mixinMonitoringContext(get_current_FunctionDeclaration_mixinMonitoringContext());
|
|
109
|
+
use_current_FunctionDeclaration_normalizeError(get_old_FunctionDeclaration_normalizeError());
|
|
110
|
+
use_old_FunctionDeclaration_normalizeError(get_current_FunctionDeclaration_normalizeError());
|
|
111
|
+
use_current_FunctionDeclaration_numberFromString(get_old_FunctionDeclaration_numberFromString());
|
|
112
|
+
use_old_FunctionDeclaration_numberFromString(get_current_FunctionDeclaration_numberFromString());
|
|
113
|
+
use_current_FunctionDeclaration_overwriteStack(get_old_FunctionDeclaration_overwriteStack());
|
|
114
|
+
use_old_FunctionDeclaration_overwriteStack(get_current_FunctionDeclaration_overwriteStack());
|
|
115
|
+
use_current_FunctionDeclaration_raiseConnectedEvent(get_old_FunctionDeclaration_raiseConnectedEvent());
|
|
116
|
+
use_old_FunctionDeclaration_raiseConnectedEvent(get_current_FunctionDeclaration_raiseConnectedEvent());
|
|
117
|
+
use_current_FunctionDeclaration_safeRaiseEvent(get_old_FunctionDeclaration_safeRaiseEvent());
|
|
118
|
+
use_old_FunctionDeclaration_safeRaiseEvent(get_current_FunctionDeclaration_safeRaiseEvent());
|
|
119
|
+
use_current_VariableDeclaration_sessionStorageConfigProvider(get_old_VariableDeclaration_sessionStorageConfigProvider());
|
|
120
|
+
use_old_VariableDeclaration_sessionStorageConfigProvider(get_current_VariableDeclaration_sessionStorageConfigProvider());
|
|
121
|
+
use_current_VariableDeclaration_tagCodeArtifacts(get_old_VariableDeclaration_tagCodeArtifacts());
|
|
122
|
+
use_old_VariableDeclaration_tagCodeArtifacts(get_current_VariableDeclaration_tagCodeArtifacts());
|
|
123
|
+
use_current_VariableDeclaration_tagData(get_old_VariableDeclaration_tagData());
|
|
124
|
+
use_old_VariableDeclaration_tagData(get_current_VariableDeclaration_tagData());
|
|
125
|
+
use_current_FunctionDeclaration_validatePrecondition(get_old_FunctionDeclaration_validatePrecondition());
|
|
126
|
+
use_old_FunctionDeclaration_validatePrecondition(get_current_FunctionDeclaration_validatePrecondition());
|
|
127
|
+
use_current_FunctionDeclaration_wrapError(get_old_FunctionDeclaration_wrapError());
|
|
128
|
+
use_old_FunctionDeclaration_wrapError(get_current_FunctionDeclaration_wrapError());
|
|
129
|
+
use_current_FunctionDeclaration_wrapErrorAndLog(get_old_FunctionDeclaration_wrapErrorAndLog());
|
|
130
|
+
use_old_FunctionDeclaration_wrapErrorAndLog(get_current_FunctionDeclaration_wrapErrorAndLog());
|
|
131
|
+
export {};
|
|
132
|
+
//# sourceMappingURL=validateTelemetryUtilsPrevious.generated.js.map
|