Skip to content

Commit

Permalink
Don't collect process starttime as it's not being used on consolehost…
Browse files Browse the repository at this point in the history
… startup (PowerShell#10294)

* mark _readyForInputTimeInMS member as part of LEGACYTELEMETRY
* move _interactiveCommandCount to LEGACYTELEMETRY
  • Loading branch information
SteveL-MSFT authored and iSazonov committed Aug 6, 2019
1 parent 7034c8b commit 3ca5a1b
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit 3ca5a1b

Please sign in to comment.