Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,11 +1023,12 @@ bool IHostProvidesTelemetryData.HostIsInteractive
double IHostProvidesTelemetryData.ReadyForInputTimeInMS { get { return _readyForInputTimeInMS; } }

int IHostProvidesTelemetryData.InteractiveCommandCount { get { return _interactiveCommandCount; } }
#endif

private double _profileLoadTimeInMS;
private double _readyForInputTimeInMS;
private int _interactiveCommandCount;
#endif

private double _profileLoadTimeInMS;

#endregion overrides

Expand Down Expand Up @@ -1602,8 +1603,10 @@ private void DoCreateRunspace(string initialCommand, bool skipProfiles, bool sta
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);
}
Expand Down Expand Up @@ -2517,8 +2520,10 @@ e is RemoteException ||
}
}

#if LEGACYTELEMETRY
if (!inBlockMode)
s_theConsoleHost._interactiveCommandCount += 1;
#endif
}
}
// NTRAID#Windows Out Of Band Releases-915506-2005/09/09
Expand Down