예제 #1
0
 public Dictionary <string, string> GetTelemetryCommonProperties()
 {
     return(new Dictionary <string, string>
     {
         { OSVersion, RuntimeEnvironment.OperatingSystemVersion },
         { OSPlatform, RuntimeEnvironment.OperatingSystemPlatform.ToString() },
         { OutputRedirected, Console.IsOutputRedirected.ToString() },
         { RuntimeId, RuntimeInformation.RuntimeIdentifier },
         { ProductVersion, Product.Version },
         { TelemetryProfile, Environment.GetEnvironmentVariable(TelemetryProfileEnvironmentVariable) },
         { DockerContainer, _userLevelCacheWriter.RunWithCache(IsDockerContainerCacheKey, () => _dockerContainerDetector.IsDockerContainer().ToString("G")) },
         { CurrentPathHash, _hasher(_getCurrentDirectory()) },
         // we don't want to recalcuate a new id for every new SDK version. Reuse the same path accross versions.
         // If we change the format of the cache later.
         // We need to rename the cache from v1 to v2
         { MachineId,
           _userLevelCacheWriter.RunWithCacheInFilePath(
               Path.Combine(
                   CliFolderPathCalculator.DotnetUserProfileFolderPath,
                   $"{MachineIdCacheKey}.v1.dotnetUserLevelCache"),
               GetMachineId) },
         { KernelVersion, GetKernelVersion() },
         { InstallationType, ExternalTelemetryProperties.GetInstallationType() },
         { ProductType, ExternalTelemetryProperties.GetProductType() },
         { LibcRelease, ExternalTelemetryProperties.GetLibcRelease() },
         { LibcVersion, ExternalTelemetryProperties.GetLibcVersion() }
     });
 }
예제 #2
0
 public Dictionary <string, string> GetTelemetryCommonProperties()
 {
     return(new Dictionary <string, string>
     {
         { OSVersion, RuntimeEnvironment.OperatingSystemVersion },
         { OSPlatform, RuntimeEnvironment.OperatingSystemPlatform.ToString() },
         { RuntimeId, RuntimeEnvironment.GetRuntimeIdentifier() },
         { ProductVersion, Product.Version },
         { TelemetryProfile, Environment.GetEnvironmentVariable(TelemetryProfileEnvironmentVariable) },
         { DockerContainer, _userLevelCacheWriter.RunWithCache(IsDockerContainerCacheKey, () => _dockerContainerDetector.IsDockerContainer().ToString("G")) },
         { CurrentPathHash, _hasher(_getCurrentDirectory()) },
         { MachineId, _userLevelCacheWriter.RunWithCache(MachineIdCacheKey, GetMachineId) },
         { KernelVersion, GetKernelVersion() },
         { InstallationType, ExternalTelemetryProperties.GetInstallationType() },
         { ProductType, ExternalTelemetryProperties.GetProductType() },
         { LibcRelease, ExternalTelemetryProperties.GetLibcRelease() },
         { LibcVersion, ExternalTelemetryProperties.GetLibcVersion() }
     });
 }