예제 #1
0
        internal void LogStartUpInformation(PerformanceLogStartupInformation startupInfo)
        {
            if (!IsEnabled())
            {
                return;
            }

            DotnetVersionFile versionFile = DotnetFiles.VersionFileObject;
            string            commitSha   = versionFile.CommitSha ?? "N/A";

            LogMachineConfiguration();
            OSInfo(RuntimeEnvironment.OperatingSystem, RuntimeEnvironment.OperatingSystemVersion, RuntimeEnvironment.OperatingSystemPlatform.ToString());
            SDKInfo(Product.Version, commitSha, RuntimeInformation.RuntimeIdentifier, versionFile.BuildRid, AppContext.BaseDirectory);
            EnvironmentInfo(Environment.CommandLine);
            LogMemoryConfiguration();
            LogDrives();

            // It's possible that IsEnabled returns true if an out-of-process collector such as ETW is enabled.
            // If the perf log hasn't been enabled, then startupInfo will be null, so protect against nullref here.
            if (startupInfo != null)
            {
                if (startupInfo.TimedAssembly != null)
                {
                    AssemblyLoad(startupInfo.TimedAssembly.GetName().Name, startupInfo.AssemblyLoadTime.TotalMilliseconds);
                }

                Process  currentProcess = Process.GetCurrentProcess();
                TimeSpan latency        = startupInfo.MainTimeStamp - currentProcess.StartTime;
                HostLatency(latency.TotalMilliseconds);
            }
        }
예제 #2
0
        private static string GetDisplayRid(DotnetVersionFile versionFile)
        {
            FrameworkDependencyFile fxDepsFile = new FrameworkDependencyFile();

            string currentRid = RuntimeEnvironment.GetRuntimeIdentifier();

            // if the current RID isn't supported by the shared framework, display the RID the CLI was
            // built with instead, so the user knows which RID they should put in their "runtimes" section.
            return(fxDepsFile.IsRuntimeSupported(currentRid) ?
                   currentRid :
                   versionFile.BuildRid);
        }
예제 #3
0
        private static void PrintInfo()
        {
            DotnetVersionFile versionFile = DotnetFiles.VersionFileObject;
            var commitSha = versionFile.CommitSha ?? "N/A";

            Reporter.Output.WriteLine($"{LocalizableStrings.DotNetSdkInfoLabel}");
            Reporter.Output.WriteLine($" Version:   {Product.Version}");
            Reporter.Output.WriteLine($" Commit:    {commitSha}");
            Reporter.Output.WriteLine();
            Reporter.Output.WriteLine($"{LocalizableStrings.DotNetRuntimeInfoLabel}");
            Reporter.Output.WriteLine($" OS Name:     {RuntimeEnvironment.OperatingSystem}");
            Reporter.Output.WriteLine($" OS Version:  {RuntimeEnvironment.OperatingSystemVersion}");
            Reporter.Output.WriteLine($" OS Platform: {RuntimeEnvironment.OperatingSystemPlatform}");
            Reporter.Output.WriteLine($" RID:         {GetDisplayRid(versionFile)}");
            Reporter.Output.WriteLine($" Base Path:   {ApplicationEnvironment.ApplicationBasePath}");
        }
예제 #4
0
        private static void PrintInfo()
        {
            HelpCommand.PrintVersionHeader();

            DotnetVersionFile versionFile = DotnetFiles.VersionFileObject;
            var commitSha = versionFile.CommitSha ?? "N/A";

            Reporter.Output.WriteLine();
            Reporter.Output.WriteLine("Product Information:");
            Reporter.Output.WriteLine($" Version:            {Product.Version}");
            Reporter.Output.WriteLine($" Commit SHA-1 hash:  {commitSha}");
            Reporter.Output.WriteLine();
            Reporter.Output.WriteLine("Runtime Environment:");
            Reporter.Output.WriteLine($" OS Name:     {RuntimeEnvironment.OperatingSystem}");
            Reporter.Output.WriteLine($" OS Version:  {RuntimeEnvironment.OperatingSystemVersion}");
            Reporter.Output.WriteLine($" OS Platform: {RuntimeEnvironment.OperatingSystemPlatform}");
            Reporter.Output.WriteLine($" RID:         {GetDisplayRid(versionFile)}");
        }
예제 #5
0
        private static string GetProductVersion()
        {
            DotnetVersionFile versionFile = DotnetFiles.VersionFileObject;

            return(versionFile.BuildNumber ?? string.Empty);
        }