本文整理匯總了TypeScript中applicationinsights-js.AppInsights類的典型用法代碼示例。如果您正苦於以下問題:TypeScript AppInsights類的具體用法?TypeScript AppInsights怎麽用?TypeScript AppInsights使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了AppInsights類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: trackException
trackException(
exception: Error,
handledAt: string,
properties?: { [name: string]: string },
measurements?: { [name: string]: number }) {
AppInsights.trackException(exception, handledAt, properties, measurements);
}
示例2: trackPageViewEnd
trackPageViewEnd(
name: string,
url: string,
properties?: { [name: string]: string },
measurements?: { [name: string]: number }) {
AppInsights.stopTrackPage(name, url, properties, measurements);
}
示例3: trackPageView
trackPageView(
name: string,
url: string,
properties?: { [name: string]: string },
measurements?: { [name: string]: number },
pageViewDuration?: number) {
AppInsights.trackPageView(name, url, properties, measurements, pageViewDuration);
}
示例4: trackDependencyCall
trackDependencyCall(
method: string,
absoluteUrl: string,
pathName: string,
totalTime: number,
success: boolean,
resultCode: number) {
AppInsights.trackDependency(this.newId(), method, absoluteUrl, pathName, totalTime, success, resultCode);
}
示例5: log
public log(entry: LogEntry): void {
switch (entry.level) {
case LogLevel.Error:
AppInsights.trackException(new Error(entry.message), null, { Severity: "Error" });
break;
case LogLevel.Warning:
AppInsights.trackException(new Error(entry.message), null, { Severity: "Warning" });
break;
case LogLevel.Info:
AppInsights.trackException(new Error(entry.message), null, { Severity: "Info" });
break;
default:
AppInsights.trackException(new Error(entry.message), null, { Severity: "None" });
break;
}
}
示例6: enableProdMode
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppInsights } from 'applicationinsights-js';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
declare var window: any;
if(window.muscularityConfig && window.muscularityConfig.instrumentationKey) {
AppInsights.downloadAndSetup({ instrumentationKey: window.muscularityConfig.instrumentationKey });
}
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
示例7: trackEvent
trackEvent(name: string, properties?: { [name: string]: string }, measurements?: { [name: string]: number }) {
AppInsights.trackEvent(name, properties, measurements);
}
示例8: trackPageViewStart
trackPageViewStart(name: string) {
AppInsights.startTrackPage(name);
}