本文整理汇总了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);
}