From 3ca5a1bdb031eeb9453b1481bcfa23eee6d89aec Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 5 Aug 2019 20:55:16 -0700 Subject: [PATCH] Don't collect process starttime as it's not being used on consolehost startup (#10294) * mark _readyForInputTimeInMS member as part of LEGACYTELEMETRY * move _interactiveCommandCount to LEGACYTELEMETRY --- .../host/msh/ConsoleHost.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs index 226e449713..6b461fa603 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs @@ -1023,11 +1023,12 @@ namespace Microsoft.PowerShell double IHostProvidesTelemetryData.ReadyForInputTimeInMS { get { return _readyForInputTimeInMS; } } int IHostProvidesTelemetryData.InteractiveCommandCount { get { return _interactiveCommandCount; } } + + private double _readyForInputTimeInMS; + private int _interactiveCommandCount; #endif private double _profileLoadTimeInMS; - private double _readyForInputTimeInMS; - private int _interactiveCommandCount; #endregion overrides @@ -1602,8 +1603,10 @@ namespace Microsoft.PowerShell PSTask.PowershellConsoleStartup, PSKeyword.UseAlwaysOperational); } +#if LEGACYTELEMETRY // Record how long it took from process start to runspace open for telemetry. _readyForInputTimeInMS = (DateTime.Now - Process.GetCurrentProcess().StartTime).TotalMilliseconds; +#endif DoRunspaceInitialization(skipProfiles, initialCommand, configurationName, initialCommandArgs); } @@ -2517,8 +2520,10 @@ namespace Microsoft.PowerShell } } +#if LEGACYTELEMETRY if (!inBlockMode) s_theConsoleHost._interactiveCommandCount += 1; +#endif } } // NTRAID#Windows Out Of Band Releases-915506-2005/09/09