Skip to content

Stream handling, param block, PowerShellManager #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
made timer threadstatic and deleted StartupArgumentsTests
  • Loading branch information
TylerLeonhardt committed Aug 29, 2018
commit f1271e3e5a1c5eccc49e3c8876a23838999c8c3e
13 changes: 6 additions & 7 deletions src/Azure.Functions.PowerShell.Worker/Utility/ExecutionTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ namespace Microsoft.Azure.Functions.PowerShellWorker.Utility
/// </example>
public struct ExecutionTimer : IDisposable
{
readonly RpcLogger _logger;
[ThreadStatic]
private static readonly Stopwatch s_stopwatch = new Stopwatch();

readonly RpcLogger _logger;
readonly string _message;

readonly Stopwatch _stopwatch;

/// <summary>
/// Create a new execution timer and start it.
/// </summary>
Expand All @@ -43,7 +43,7 @@ public static ExecutionTimer Start(
string message)
{
var timer = new ExecutionTimer(logger, message);
timer._stopwatch.Start();
s_stopwatch.Start();
return timer;
}

Expand All @@ -53,7 +53,6 @@ internal ExecutionTimer(
{
_logger = logger;
_message = message;
_stopwatch = new Stopwatch();
}

/// <summary>
Expand All @@ -62,12 +61,12 @@ internal ExecutionTimer(
/// </summary>
public void Dispose()
{
_stopwatch.Stop();
s_stopwatch.Stop();

string logMessage = new StringBuilder()
.Append(_message)
.Append(" [")
.Append(_stopwatch.ElapsedMilliseconds)
.Append(s_stopwatch.ElapsedMilliseconds)
.Append("ms]")
.ToString();

Expand Down

This file was deleted.