Search in sources :

Example 6 with GradleRuntimeConfig

use of com.microsoft.azure.gradle.configuration.GradleRuntimeConfig in project azure-gradle-plugins by microsoft.

the class GradleFunctionContext method getTelemetryProperties.

public Map<String, String> getTelemetryProperties() {
    final Map<String, String> result = new HashMap<>();
    final GradleRuntimeConfig runtime = getRuntime();
    final String javaVersion = runtime == null ? null : runtime.javaVersion();
    final String os = runtime == null ? null : runtime.os();
    final boolean isDockerFunction = runtime != null && StringUtils.isNotEmpty(runtime.image());
    result.put(FUNCTION_JAVA_VERSION_KEY, StringUtils.isEmpty(javaVersion) ? "" : javaVersion);
    result.put(FUNCTION_RUNTIME_KEY, StringUtils.isEmpty(os) ? "" : os);
    result.put(FUNCTION_IS_DOCKER_KEY, String.valueOf(isDockerFunction));
    result.put(FUNCTION_REGION_KEY, getRegion());
    result.put(FUNCTION_PRICING_KEY, getPricingTier());
    result.put(DISABLE_APP_INSIGHTS_KEY, String.valueOf(isDisableAppInsights()));
    result.put(DEPLOY_TO_SLOT_KEY, String.valueOf(StringUtils.isEmpty(getDeploymentSlotName())));
    return result;
}
Also used : GradleRuntimeConfig(com.microsoft.azure.gradle.configuration.GradleRuntimeConfig) HashMap(java.util.HashMap)

Aggregations

GradleRuntimeConfig (com.microsoft.azure.gradle.configuration.GradleRuntimeConfig)6 HashMap (java.util.HashMap)2 GradleDeploymentSlotConfig (com.microsoft.azure.gradle.configuration.GradleDeploymentSlotConfig)1 RuntimeConfig (com.microsoft.azure.toolkit.lib.appservice.config.RuntimeConfig)1 JavaVersion (com.microsoft.azure.toolkit.lib.appservice.model.JavaVersion)1 OperatingSystem (com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem)1 AzureString (com.microsoft.azure.toolkit.lib.common.bundle.AzureString)1 AzureToolkitRuntimeException (com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException)1 DockerImageType (com.microsoft.azure.toolkit.lib.legacy.appservice.DockerImageType)1