Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DataLossAnalyzer and PerfAnalyzer #404

Merged
merged 3 commits into from Feb 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion JavaScript/JavaScriptSDK.Interfaces/IConfig.ts
Expand Up @@ -28,7 +28,6 @@
isCookieUseDisabled?: boolean;
cookieDomain?: string;
isRetryDisabled?: boolean;
isPerfAnalyzerEnabled?: boolean;
url?: string;
isStorageUseDisabled?: boolean;
isBeaconApiDisabled?: boolean;
Expand Down
Expand Up @@ -89,4 +89,5 @@ class DataLossAnalyzerTests extends TestClass {
}
}

new DataLossAnalyzerTests().registerTests();
// Uncomment if you want to use DataLossanalyzer
// new DataLossAnalyzerTests().registerTests();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better way to disable DataLossAnalyzer rather then commenting it in 4 places? E.g. some configuration setting to only change one bit back and worth and avoid the case when someone forgets to uncomment/comment one of those.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this requires a refactoring of DataLossAnalyzer (#208). I'll do that once we have this task done #289.

Expand Up @@ -2,7 +2,7 @@
/// <reference path="../../JavaScriptSDK/Util.ts"/>
/// <reference path="../../JavaScriptSDK/sender.ts" />
/// <reference path="../../JavaScriptSDK/SendBuffer.ts"/>
/// <reference path="../../JavaScriptSDK/appinsights.ts" />
/// <reference path="../../javascriptsdk/appinsights.ts" />
/// <reference path="../../JavaScriptSDK/util.ts" />

class SenderWrapper extends Microsoft.ApplicationInsights.Sender {
Expand Down
7 changes: 0 additions & 7 deletions JavaScript/JavaScriptSDK/AppInsights.ts
Expand Up @@ -4,10 +4,8 @@
/// <reference path="../JavaScriptSDK.Interfaces/Contracts/Generated/SessionState.ts"/>
/// <reference path="./Telemetry/PageViewManager.ts"/>
/// <reference path="./Telemetry/PageVisitTimeManager.ts"/>
/// <reference path="./Telemetry/PerformanceAnalyzer.ts"/>
/// <reference path="./Telemetry/RemoteDependencyData.ts"/>
/// <reference path="./ajax/ajax.ts"/>
/// <reference path="./DataLossAnalyzer.ts"/>
/// <reference path="./SplitTest.ts"/>
/// <reference path="../JavaScriptSDK.Interfaces/IAppInsights.ts"/>

Expand Down Expand Up @@ -43,7 +41,6 @@ module Microsoft.ApplicationInsights {
private _pageTracking: Timing;
private _pageViewManager: Microsoft.ApplicationInsights.Telemetry.PageViewManager;
private _pageVisitTimeManager: Microsoft.ApplicationInsights.Telemetry.PageVisitTimeManager;
private _performanceAnalyzer: Microsoft.ApplicationInsights.PerformanceAnalyzer;

public config: IConfig;
public context: TelemetryContext;
Expand Down Expand Up @@ -131,10 +128,6 @@ module Microsoft.ApplicationInsights {
(pageName, pageUrl, pageVisitTime) => this.trackPageVisitTime(pageName, pageUrl, pageVisitTime));

if (!this.config.disableAjaxTracking) { new Microsoft.ApplicationInsights.AjaxMonitor(this); }

if (this.config.isPerfAnalyzerEnabled) {
this._performanceAnalyzer = new Microsoft.ApplicationInsights.PerformanceAnalyzer(this);
}
}

public sendPageViewInternal(name?: string, url?: string, duration?: number, properties?: Object, measurements?: Object) {
Expand Down
3 changes: 3 additions & 0 deletions JavaScript/JavaScriptSDK/DataLossAnalyzer.ts
@@ -1,6 +1,9 @@
module Microsoft.ApplicationInsights {
"use strict";

/* Data loss analyzer is disabled by default.
* Uncomment code in Sender, SendBuffer and unit tests if you want to enable it
*/
export class DataLossAnalyzer {
static enabled = false;
static appInsights: Microsoft.ApplicationInsights.AppInsights;
Expand Down
1 change: 0 additions & 1 deletion JavaScript/JavaScriptSDK/Initialization.ts
Expand Up @@ -168,7 +168,6 @@ module Microsoft.ApplicationInsights {

config.isBeaconApiDisabled = Util.stringToBoolOrDefault(config.isBeaconApiDisabled, true);
config.disableCorrelationHeaders = Util.stringToBoolOrDefault(config.disableCorrelationHeaders, true);
config.isPerfAnalyzerEnabled = Util.stringToBoolOrDefault(config.isPerfAnalyzerEnabled);
config.disableFlushOnBeforeUnload = Util.stringToBoolOrDefault(config.disableFlushOnBeforeUnload);
config.enableSessionStorageBuffer = Util.stringToBoolOrDefault(config.enableSessionStorageBuffer, true);
config.isRetryDisabled = Util.stringToBoolOrDefault(config.isRetryDisabled);
Expand Down
1 change: 0 additions & 1 deletion JavaScript/JavaScriptSDK/JavaScriptSDK.csproj
Expand Up @@ -125,7 +125,6 @@
<TypeScriptCompile Include="ajax\ajaxRecord.ts" />
<TypeScriptCompile Include="ajax\ajaxUtils.ts" />
<TypeScriptCompile Include="HashCodeScoreGenerator.ts" />
<TypeScriptCompile Include="Telemetry\PerformanceAnalyzer.ts" />
<TypeScriptCompile Include="SendBuffer.ts" />
<TypeScriptCompile Include="Sender.ts" />
<TypeScriptCompile Include="SplitTest.ts" />
Expand Down
4 changes: 2 additions & 2 deletions JavaScript/JavaScriptSDK/SendBuffer.ts
Expand Up @@ -11,7 +11,6 @@
/// <reference path="Context/Session.ts"/>
/// <reference path="Context/User.ts"/>
/// <reference path="ajax/ajax.ts"/>
/// <reference path="DataLossAnalyzer.ts"/>

module Microsoft.ApplicationInsights {
"use strict";
Expand Down Expand Up @@ -134,7 +133,8 @@ module Microsoft.ApplicationInsights {
}

// update DataLossAnalyzer with the number of recovered items
DataLossAnalyzer.itemsRestoredFromSessionBuffer = this._buffer.length;
// Uncomment if you want to use DataLossanalyzer
// DataLossAnalyzer.itemsRestoredFromSessionBuffer = this._buffer.length;

this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []);
this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer);
Expand Down
8 changes: 5 additions & 3 deletions JavaScript/JavaScriptSDK/Sender.ts
Expand Up @@ -12,7 +12,6 @@
/// <reference path="Context/Session.ts"/>
/// <reference path="Context/User.ts"/>
/// <reference path="ajax/ajax.ts"/>
/// <reference path="DataLossAnalyzer.ts"/>
/// <reference path="SendBuffer.ts"/>

interface XDomainRequest extends XMLHttpRequestEventTarget {
Expand Down Expand Up @@ -207,7 +206,8 @@ module Microsoft.ApplicationInsights {
// ensure an invocation timeout is set
this._setupTimer();

DataLossAnalyzer.incrementItemsQueued();
// Uncomment if you want to use DataLossanalyzer
// DataLossAnalyzer.incrementItemsQueued();
} catch (e) {
_InternalLogging.throwInternal(
LoggingSeverity.WARNING,
Expand Down Expand Up @@ -554,7 +554,9 @@ module Microsoft.ApplicationInsights {
* success handler
*/
public _onSuccess(payload: string[], countOfItemsInPayload: number) {
DataLossAnalyzer.decrementItemsQueued(countOfItemsInPayload);
// Uncomment if you want to use DataLossanalyzer
// DataLossAnalyzer.decrementItemsQueued(countOfItemsInPayload);

this._buffer.clearSent(payload);
}
}
Expand Down
108 changes: 0 additions & 108 deletions JavaScript/JavaScriptSDK/Telemetry/PerformanceAnalyzer.ts

This file was deleted.