Skip to content

Commit 3ca5a1b

Browse files
SteveL-MSFTiSazonov
authored andcommitted
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
1 parent 7034c8b commit 3ca5a1b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,11 +1023,12 @@ bool IHostProvidesTelemetryData.HostIsInteractive
10231023
double IHostProvidesTelemetryData.ReadyForInputTimeInMS { get { return _readyForInputTimeInMS; } }
10241024

10251025
int IHostProvidesTelemetryData.InteractiveCommandCount { get { return _interactiveCommandCount; } }
1026-
#endif
10271026

1028-
private double _profileLoadTimeInMS;
10291027
private double _readyForInputTimeInMS;
10301028
private int _interactiveCommandCount;
1029+
#endif
1030+
1031+
private double _profileLoadTimeInMS;
10311032

10321033
#endregion overrides
10331034

@@ -1602,8 +1603,10 @@ private void DoCreateRunspace(string initialCommand, bool skipProfiles, bool sta
16021603
PSTask.PowershellConsoleStartup, PSKeyword.UseAlwaysOperational);
16031604
}
16041605

1606+
#if LEGACYTELEMETRY
16051607
// Record how long it took from process start to runspace open for telemetry.
16061608
_readyForInputTimeInMS = (DateTime.Now - Process.GetCurrentProcess().StartTime).TotalMilliseconds;
1609+
#endif
16071610

16081611
DoRunspaceInitialization(skipProfiles, initialCommand, configurationName, initialCommandArgs);
16091612
}
@@ -2517,8 +2520,10 @@ e is RemoteException ||
25172520
}
25182521
}
25192522

2523+
#if LEGACYTELEMETRY
25202524
if (!inBlockMode)
25212525
s_theConsoleHost._interactiveCommandCount += 1;
2526+
#endif
25222527
}
25232528
}
25242529
// NTRAID#Windows Out Of Band Releases-915506-2005/09/09

0 commit comments

Comments
 (0)