Skip to content

Commit 984854c

Browse files
committed
Merge branch 'jacksonweber/enable-customer-sdk-stats' of https://github.com/JacksonWeber/ApplicationInsights-JS into jacksonweber/enable-customer-sdk-stats
2 parents 3d33238 + 7aa167b commit 984854c

155 files changed

Lines changed: 1807 additions & 1317 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AISKU/Tests/Unit/src/applicationinsights.e2e.tests.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,6 @@ export class ApplicationInsightsTests extends AITestClass {
860860
Assert.fail("Fetch failed with status: " + dumpObj(res));
861861
}
862862
} catch (e) {
863-
this._ctx.err = e;
864863
Assert.fail("Fetch Error: " + dumpObj(e));
865864
}
866865
}

AISKU/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@
3838
"sinon": "^7.3.1",
3939
"@microsoft/api-extractor": "^7.40.0",
4040
"finalhandler": "^1.1.1",
41-
"grunt": "^1.5.3",
42-
"grunt-cli": "^1.4.3",
43-
"@nevware21/ts-async": ">= 0.5.5 < 2.x",
44-
"@nevware21/grunt-ts-plugin": "^0.4.3",
45-
"@nevware21/grunt-eslint-ts": "^0.2.2",
41+
"grunt": "^1.6.1",
42+
"grunt-cli": "^1.5.0",
43+
"@nevware21/grunt-ts-plugin": "^0.5.1",
44+
"@nevware21/grunt-eslint-ts": "^0.5.1",
4645
"globby": "^11.0.0",
4746
"magic-string": "^0.25.7",
4847
"pako": "^2.0.3",

AISKULight/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
3535
"@microsoft/applicationinsights-rollup-es5": "1.0.2",
3636
"@microsoft/api-extractor": "^7.40.0",
37-
"grunt": "^1.5.3",
38-
"grunt-cli": "^1.4.3",
39-
"@nevware21/grunt-ts-plugin": "^0.4.3",
40-
"@nevware21/grunt-eslint-ts": "^0.2.2",
37+
"grunt": "^1.6.1",
38+
"grunt-cli": "^1.5.0",
39+
"@nevware21/grunt-ts-plugin": "^0.5.1",
40+
"@nevware21/grunt-eslint-ts": "^0.5.1",
4141
"globby": "^11.0.0",
4242
"magic-string": "^0.25.7",
4343
"pako": "^2.0.3",

channels/1ds-post-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@microsoft/applicationinsights-rollup-es5": "1.0.2",
3838
"@microsoft/api-extractor": "^7.40.0",
3939
"globby": "^11.0.0",
40-
"grunt": "^1.5.3",
40+
"grunt": "^1.6.1",
4141
"sinon": "^7.3.1",
4242
"@rollup/plugin-commonjs": "^24.0.0",
4343
"@rollup/plugin-node-resolve": "^15.0.1",

channels/applicationinsights-channel-js/Tests/Unit/src/Sender.tests.ts

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,97 @@ export class SenderTests extends AITestClass {
444444
}
445445
});
446446

447+
this.testCase({
448+
name: "zip test: gzip encode is working and content-encode header is set (feature opt-in)",
449+
pollDelay: 10,
450+
useFakeTimers: true,
451+
useFakeServer: true,
452+
test: () => {
453+
this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST');
454+
let core = new AppInsightsCore();
455+
456+
let coreConfig = {
457+
instrumentationKey: "000e0000-e000-0000-a000-000000000000",
458+
featureOptIn : {["zipPayload"]: {mode: 3}},
459+
extensionConfig: {
460+
[this._sender.identifier]: {
461+
httpXHROverride: this.xhrOverride,
462+
alwaysUseXhrOverride: true,
463+
}
464+
}
465+
}
466+
467+
core.initialize(coreConfig, [this._sender]);
468+
469+
const telemetryItem: ITelemetryItem = {
470+
name: 'fake item with some really long name to take up space quickly',
471+
iKey: 'iKey',
472+
baseType: 'some type',
473+
baseData: {}
474+
};
475+
this._sender.processTelemetry(telemetryItem);
476+
this._sender.flush();
477+
this.clock.tick(10);
478+
479+
return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => {
480+
if (this.genericSpy.called) {
481+
let request = this.genericSpy.getCall(0).args[0];
482+
let gzipData = request.data;
483+
QUnit.assert.ok(gzipData, "data should be set");
484+
QUnit.assert.equal(true, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should be gzip encoded");
485+
QUnit.assert.equal(request.headers["Content-Encoding"], "gzip", "telemetry should be gzip encoded");
486+
return true;
487+
}
488+
return false;
489+
}, "Wait for promise response" + new Date().toISOString(), 60, 1000));
490+
}
491+
});
492+
493+
this.testCase({
494+
name: "zip test: gzip encode is disabled (feature opt-in not set)",
495+
pollDelay: 10,
496+
useFakeTimers: true,
497+
useFakeServer: true,
498+
test: () => {
499+
this.genericSpy = this.sandbox.spy(this.xhrOverride, 'sendPOST');
500+
let core = new AppInsightsCore();
501+
502+
let coreConfig = {
503+
instrumentationKey: "000e0000-e000-0000-a000-000000000000",
504+
extensionConfig: {
505+
[this._sender.identifier]: {
506+
httpXHROverride: this.xhrOverride,
507+
alwaysUseXhrOverride: true,
508+
}
509+
}
510+
}
511+
512+
core.initialize(coreConfig, [this._sender]);
513+
514+
const telemetryItem: ITelemetryItem = {
515+
name: 'fake item with some really long name to take up space quickly',
516+
iKey: 'iKey',
517+
baseType: 'some type',
518+
baseData: {}
519+
};
520+
this._sender.processTelemetry(telemetryItem);
521+
this._sender.flush();
522+
this.clock.tick(10);
523+
524+
return this._asyncQueue().concat(PollingAssert.asyncTaskPollingAssert(() => {
525+
if (this.genericSpy.called){
526+
let request = this.genericSpy.getCall(0).args[0];
527+
let gzipData = request.data;
528+
QUnit.assert.ok(gzipData, "data should be set");
529+
QUnit.assert.equal(false, gzipData[0] === 0x1F && gzipData[1] === 0x8B, "telemetry should not be gzip encoded");
530+
QUnit.assert.ok(!("Content-Encoding" in request.headers), "telemetry should not be gzip encoded");
531+
return true;
532+
}
533+
return false;
534+
}, "Wait for promise response" + new Date().toISOString(), 60, 1000));
535+
}
536+
});
537+
447538
this.testCase({
448539
name: "Channel Config: Endpoint Url can be set from root dynamically",
449540
useFakeTimers: true,

channels/applicationinsights-channel-js/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
"@microsoft/applicationinsights-rollup-es5": "1.0.2",
3535
"@microsoft/api-extractor": "^7.40.0",
3636
"@types/sinon": "4.3.3",
37-
"grunt": "^1.5.3",
38-
"grunt-cli": "^1.4.3",
39-
"@nevware21/grunt-ts-plugin": "^0.4.3",
40-
"@nevware21/grunt-eslint-ts": "^0.2.2",
37+
"grunt": "^1.6.1",
38+
"grunt-cli": "^1.5.0",
39+
"@nevware21/grunt-ts-plugin": "^0.5.1",
40+
"@nevware21/grunt-eslint-ts": "^0.5.1",
4141
"globby": "^11.0.0",
4242
"magic-string": "^0.25.7",
4343
"@rollup/plugin-commonjs": "^24.0.0",

channels/offline-channel-js/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
"@microsoft/applicationinsights-rollup-es5": "1.0.2",
4545
"@microsoft/api-extractor": "^7.40.0",
4646
"@types/sinon": "4.3.3",
47-
"grunt": "^1.5.3",
48-
"grunt-cli": "^1.4.3",
49-
"@nevware21/grunt-ts-plugin": "^0.4.3",
50-
"@nevware21/grunt-eslint-ts": "^0.2.2",
47+
"grunt": "^1.6.1",
48+
"grunt-cli": "^1.5.0",
49+
"@nevware21/grunt-ts-plugin": "^0.5.1",
50+
"@nevware21/grunt-eslint-ts": "^0.5.1",
5151
"globby": "^11.0.0",
5252
"magic-string": "^0.25.7",
5353
"@rollup/plugin-commonjs": "^24.0.0",

channels/tee-channel-js/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
"@microsoft/applicationinsights-rollup-es5": "1.0.2",
3636
"@microsoft/api-extractor": "^7.40.0",
3737
"@types/sinon": "4.3.3",
38-
"grunt": "^1.5.3",
39-
"grunt-cli": "^1.4.3",
40-
"@nevware21/grunt-ts-plugin": "^0.4.3",
41-
"@nevware21/grunt-eslint-ts": "^0.2.2",
38+
"grunt": "^1.6.1",
39+
"grunt-cli": "^1.5.0",
40+
"@nevware21/grunt-ts-plugin": "^0.5.1",
41+
"@nevware21/grunt-eslint-ts": "^0.5.1",
4242
"globby": "^11.0.0",
4343
"magic-string": "^0.25.7",
4444
"@rollup/plugin-commonjs": "^24.0.0",

common/Tests/Framework/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"devDependencies": {
3333
"@types/qunit": "^2.19.3",
3434
"@types/sinon": "4.3.3",
35-
"grunt": "^1.5.3",
36-
"@nevware21/grunt-ts-plugin": "^0.4.3",
35+
"grunt": "^1.6.1",
36+
"@nevware21/grunt-ts-plugin": "^0.5.1",
3737
"@rollup/plugin-commonjs": "^24.0.0",
3838
"@rollup/plugin-node-resolve": "^15.0.1",
3939
"@rollup/plugin-replace": "^5.0.2",

common/config/rush/common-versions.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* instead of the latest version.
1919
*/
2020
// "some-library": "1.2.3"
21+
"glob": "7.2.3",
22+
"form-data": "^2.5.5"
2123
},
2224

2325
/**

0 commit comments

Comments
 (0)