当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript defaultClient.trackEvent方法代码示例

本文整理汇总了TypeScript中applicationinsights.defaultClient.trackEvent方法的典型用法代码示例。如果您正苦于以下问题:TypeScript defaultClient.trackEvent方法的具体用法?TypeScript defaultClient.trackEvent怎么用?TypeScript defaultClient.trackEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在applicationinsights.defaultClient的用法示例。


在下文中一共展示了defaultClient.trackEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: trackCustomEvent

export function trackCustomEvent (eventName: string, trackingProperties: {}) {
  try {
    if (appInsights.defaultClient) {
      appInsights.defaultClient.trackEvent({
        name: eventName,
        properties: trackingProperties
      })
    }
  } catch (err) {
    logger.logError(err.stack)
  }
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:12,代码来源:customEventTracker.ts

示例2: Promise

	return new Promise(resolve => {
		try {

			const sizes: any = {};
			const counts: any = {};
			for (const entry of sorted) {
				sizes[entry.name] = entry.totalSize;
				counts[entry.name] = entry.totalCount;
			}

			appInsights.setup(productJson.aiConfig.asimovKey)
				.setAutoCollectConsole(false)
				.setAutoCollectExceptions(false)
				.setAutoCollectPerformance(false)
				.setAutoCollectRequests(false)
				.setAutoCollectDependencies(false)
				.setAutoDependencyCorrelation(false)
				.start();

			appInsights.defaultClient.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1';

			/* __GDPR__
				"monacoworkbench/packagemetrics" : {
					"commit" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
					"size" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
					"count" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
				}
			*/
			appInsights.defaultClient.trackEvent({
				name: 'monacoworkbench/packagemetrics',
				properties: { commit, size: JSON.stringify(sizes), count: JSON.stringify(counts) }
			});


			appInsights.defaultClient.flush({
				callback: () => {
					appInsights.dispose();
					resolve(true);
				}
			});

		} catch (err) {
			console.error('ERROR sending build stats as telemetry event!');
			console.error(err);
			resolve(false);
		}
	});
开发者ID:PKRoma,项目名称:vscode,代码行数:47,代码来源:stats.ts

示例3: Promise

	return new Promise(resolve => {

		const measurements = Object.create(null);
		for (const entry of sorted) {
			measurements[`${entry.name}.size`] = entry.totalSize;
			measurements[`${entry.name}.count`] = entry.totalCount;
		}

		appInsights.setup(productJson.aiConfig.asimovKey)
			.setAutoCollectConsole(false)
			.setAutoCollectExceptions(false)
			.setAutoCollectPerformance(false)
			.setAutoCollectRequests(false)
			.start();

		appInsights.defaultClient.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1';
		appInsights.defaultClient.trackEvent(`bundleStats`, undefined, measurements);
		appInsights.defaultClient.sendPendingData(() => resolve());
	});
开发者ID:developers23,项目名称:vscode,代码行数:19,代码来源:stats.ts


注:本文中的applicationinsights.defaultClient.trackEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。