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


Java TelemetryConfiguration类代码示例

本文整理汇总了Java中com.microsoft.applicationinsights.TelemetryConfiguration的典型用法代码示例。如果您正苦于以下问题:Java TelemetryConfiguration类的具体用法?Java TelemetryConfiguration怎么用?Java TelemetryConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TelemetryConfiguration类属于com.microsoft.applicationinsights包,在下文中一共展示了TelemetryConfiguration类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startTelemetryClient

import com.microsoft.applicationinsights.TelemetryConfiguration; //导入依赖的package包/类
private static void startTelemetryClient() {
    TelemetryConfiguration telemetryConfiguration = TelemetryConfiguration.getActive();
    telemetryConfiguration.setInstrumentationKey(Globals.BUILD_INFO.getAzureInstrumentationKey());
    telemetryConfiguration.setTrackingIsDisabled(!Globals.prefs.shouldCollectTelemetry());
    telemetryClient = new TelemetryClient(telemetryConfiguration);
    telemetryClient.getContext().getProperties().put("JabRef version", Globals.BUILD_INFO.getVersion().toString());
    telemetryClient.getContext().getProperties().put("Java version", StandardSystemProperty.JAVA_VERSION.value());
    telemetryClient.getContext().getUser().setId(Globals.prefs.getOrCreateUserId());
    telemetryClient.getContext().getSession().setId(UUID.randomUUID().toString());
    telemetryClient.getContext().getDevice().setOperatingSystem(StandardSystemProperty.OS_NAME.value());
    telemetryClient.getContext().getDevice().setOperatingSystemVersion(StandardSystemProperty.OS_VERSION.value());
    telemetryClient.getContext().getDevice().setScreenResolution(
            Toolkit.getDefaultToolkit().getScreenSize().toString());

    telemetryClient.trackSessionState(SessionState.Start);
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:17,代码来源:Globals.java

示例2: telemetryConfig

import com.microsoft.applicationinsights.TelemetryConfiguration; //导入依赖的package包/类
@Bean
public String telemetryConfig() {
    String telemetryKey = "** Your instrumentation key **";
    if (telemetryKey != null) {
        TelemetryConfiguration.getActive().setInstrumentationKey(telemetryKey);
    }
    return telemetryKey;
}
 
开发者ID:Microsoft,项目名称:movie-db-java-on-azure,代码行数:9,代码来源:AppInsightsConfig.java

示例3: initializeTelemetryChannel

import com.microsoft.applicationinsights.TelemetryConfiguration; //导入依赖的package包/类
private static void initializeTelemetryChannel() {
    final Map<String, String> loggerData = new HashMap<String, String>();

    loggerData.put("Level", InternalLogger.LoggingLevel.ERROR.toString()); //$NON-NLS-1$
    loggerData.put("UniquePrefix", "ai-log"); //$NON-NLS-1$ //$NON-NLS-2$
    loggerData.put("BaseFolder", "AppInsights"); //$NON-NLS-1$ //$NON-NLS-2$

    InternalLogger.INSTANCE.initialize(LoggerOutputType.FILE.toString(), loggerData);

    TelemetryConfiguration.getActive().getContextInitializers().add(new TfsTelemetryInitializer());
    TelemetryConfiguration.getActive().getChannel().setDeveloperMode(
        TfsTelemetryInstrumentationInfo.isDeveloperMode());
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:14,代码来源:TfsTelemetryHelper.java

示例4: TfsTelemetryHelper

import com.microsoft.applicationinsights.TelemetryConfiguration; //导入依赖的package包/类
private TfsTelemetryHelper() {
    final String skip = System.getProperties().getProperty("com.microsoft.alm.plugin.telemetry.skipClientInitialization");
    if (StringUtils.isNotEmpty(skip) && StringUtils.equalsIgnoreCase(skip, "true")) {
        // this flag is here for testing purposes in which case we do not want to create a telemetry channel
        // or client.
        return;
    }

    // Initialize the internal logger
    final Map<String, String> loggerData = new HashMap<String, String>();
    loggerData.put("Level", InternalLogger.LoggingLevel.ERROR.toString());
    loggerData.put("UniquePrefix", UNIQUE_PREFIX);
    loggerData.put("BaseFolder", BASE_FOLDER);
    InternalLogger.INSTANCE.initialize(LoggerOutputType.FILE.toString(), loggerData);

    // Initialize the active TelemetryConfiguration
    ContextInitializer initializer = PluginServiceProvider.getInstance().getTelemetryContextInitializer();
    TelemetryConfiguration.getActive().getContextInitializers().add(initializer);

    // Create a channel to AppInsights
    final TelemetryChannel channel = TelemetryConfiguration.getActive().getChannel();
    if (channel != null) {
        channel.setDeveloperMode(TfsTelemetryInstrumentationInfo.getInstance().isDeveloperMode());
    } else {
        logger.error("Failed to load telemetry channel");
        return;
    }

    // Create the telemetry client and cache it for later use
    logger.debug("AppInsights telemetry initialized");
    logger.debug(MessageFormat.format(
            "    Developer Mode: {0}", TfsTelemetryInstrumentationInfo.getInstance().isDeveloperMode()));
    logger.debug(MessageFormat.format(
            "    Production Environment: {0}", !TfsTelemetryInstrumentationInfo.getInstance().isTestKey()));

    telemetryClient = new TelemetryClient();
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:38,代码来源:TfsTelemetryHelper.java

示例5: telemetryClient

import com.microsoft.applicationinsights.TelemetryConfiguration; //导入依赖的package包/类
@Bean
public TelemetryClient telemetryClient(TelemetryConfiguration configuration) {
    return new TelemetryClient(configuration);
}
 
开发者ID:gavlyukovskiy,项目名称:azure-application-insights-spring-boot-starter,代码行数:5,代码来源:ApplicationInsightsTelemetryAutoConfiguration.java

示例6: ApplicationInsightsWebMvcAutoConfiguration

import com.microsoft.applicationinsights.TelemetryConfiguration; //导入依赖的package包/类
@Autowired
public ApplicationInsightsWebMvcAutoConfiguration(TelemetryConfiguration telemetryConfiguration) {
    this.telemetryConfiguration = telemetryConfiguration;
}
 
开发者ID:gavlyukovskiy,项目名称:azure-application-insights-spring-boot-starter,代码行数:5,代码来源:ApplicationInsightsWebMvcAutoConfiguration.java

示例7: initializeTelemetryClient

import com.microsoft.applicationinsights.TelemetryConfiguration; //导入依赖的package包/类
private static TelemetryClient initializeTelemetryClient(String instrumentationKey) {
    TelemetryConfiguration telemetryConfiguration = TelemetryConfiguration.getActive();
    telemetryConfiguration.setInstrumentationKey(instrumentationKey);
    return new TelemetryClient(telemetryConfiguration);
}
 
开发者ID:Microsoft,项目名称:ApplicationInsights-Docker,代码行数:6,代码来源:ApplicationInsightsSender.java


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