private void LogTelemetry(TimeSpan evaluationTime, int evaluationCount, int customProjectTypeGuidCount, int solutionItemCount) { TelemetryClient.PostEvent( "execute", new Dictionary <string, object> { ["AssemblyInformationalVersion"] = ThisAssembly.AssemblyInformationalVersion, ["DevEnvFullPathSpecified"] = (!_arguments.DevEnvFullPath?.LastOrDefault().IsNullOrWhiteSpace()).ToString(), ["EntryProjectCount"] = _arguments.Projects?.Length.ToString(), ["Folders"] = _arguments.EnableFolders().ToString(), ["CollapseFolders"] = _arguments.EnableCollapseFolders().ToString(), ["IsCoreXT"] = IsCorext.ToString(), ["IsNetCore"] = IsNetCore.ToString(), ["LaunchVisualStudio"] = _arguments.ShouldLaunchVisualStudio().ToString(), ["SolutionFileFullPathSpecified"] = (!_arguments.SolutionFileFullPath?.LastOrDefault().IsNullOrWhiteSpace()).ToString(), #if NETFRAMEWORK ["Runtime"] = $".NET Framework {Environment.Version}", #elif NETCOREAPP ["Runtime"] = $".NET Core {Environment.Version}", #endif ["UseBinaryLogger"] = _arguments.BinaryLogger.HasValue.ToString(), ["UseFileLogger"] = _arguments.FileLoggerParameters.HasValue.ToString(), ["UseShellExecute"] = _arguments.EnableShellExecute().ToString(), ["CustomProjectTypeGuidCount"] = customProjectTypeGuidCount, ["ProjectCount"] = evaluationCount, ["ProjectEvaluationMilliseconds"] = evaluationTime.TotalMilliseconds, ["SolutionItemCount"] = solutionItemCount, }); }
private void LogTelemetry(TimeSpan evaluationTime, int evaluationCount, int customProjectTypeGuidCount, int solutionItemCount) { string hostName = Dns.GetHostEntry(Environment.MachineName).HostName; TelemetryClient.PostEvent( "slngen/execute", new Dictionary <string, object> { ["AssemblyInformationalVersion"] = ThisAssembly.AssemblyInformationalVersion, ["DevEnvFullPathSpecified"] = (!_arguments.DevEnvFullPath?.LastOrDefault().IsNullOrWhiteSpace()).ToString(), ["EntryProjectCount"] = _arguments.Projects?.Length.ToString(), ["Folders"] = _arguments.EnableFolders().ToString(), ["IsCoreXT"] = IsCorext.ToString(), ["IsNetCore"] = IsNetCore.ToString(), ["LaunchVisualStudio"] = _arguments.ShouldLaunchVisualStudio().ToString(), ["SolutionFileFullPathSpecified"] = (!_arguments.SolutionFileFullPath?.LastOrDefault().IsNullOrWhiteSpace()).ToString(), #if NETFRAMEWORK ["Runtime"] = $".NET Framework {Environment.Version}", #elif NETCOREAPP ["Runtime"] = $".NET Core {Environment.Version}", #endif ["UseBinaryLogger"] = _arguments.BinaryLogger.HasValue.ToString(), ["UseFileLogger"] = _arguments.FileLoggerParameters.HasValue.ToString(), ["UseShellExecute"] = _arguments.EnableShellExecute().ToString(), ["CustomProjectTypeGuidCount"] = customProjectTypeGuidCount, ["ProjectCount"] = evaluationCount, ["ProjectEvaluationMilliseconds"] = evaluationTime.TotalMilliseconds, ["SolutionItemCount"] = solutionItemCount, }, new Dictionary <string, object> { ["Username"] = hostName.EndsWith("corp.microsoft.com", StringComparison.OrdinalIgnoreCase) ? $"{Environment.UserDomainName}\\{Environment.UserName}" : null, }); }