Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion src/DependencyManagement/DependencySnapshotInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Microsoft.Azure.Functions.PowerShellWorker.DependencyManagement
using System.Collections.Generic;
using System.Management.Automation;
using System.Threading;
using System.Diagnostics;

using Microsoft.Azure.Functions.PowerShellWorker.Utility;

Expand Down Expand Up @@ -129,9 +130,12 @@ private void InstallModule(DependencyInfo module, string installingPath, PowerSh
{
try
{
var stopwatch = new Stopwatch();
stopwatch.Start();

_moduleProvider.SaveModule(pwsh, module.Name, module.ExactVersion, installingPath);

var message = string.Format(PowerShellWorkerStrings.ModuleHasBeenInstalled, module.Name, module.ExactVersion);
var message = string.Format(PowerShellWorkerStrings.ModuleHasBeenInstalled, module.Name, module.ExactVersion, stopwatch.ElapsedMilliseconds);
logger.Log(isUserOnlyLog: false, LogLevel.Trace, message);

break;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/PowerShellWorkerStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
<value>Started installing module '{0}' version '{1}'.</value>
</data>
<data name="ModuleHasBeenInstalled" xml:space="preserve">
<value>Module name '{0}' version '{1}' has been installed.</value>
<value>Module name '{0}' version '{1}' has been installed. Module installation completed in {2} ms.</value>
</data>
<data name="AcceptableFunctionAppDependenciesAlreadyInstalled" xml:space="preserve">
<value>The function app has existing dependencies installed. Updating the dependencies to the latest versions will be performed in the background. New function app instances will pick up any new dependencies.</value>
Expand Down
8 changes: 7 additions & 1 deletion test/Unit/DependencyManagement/DependencyManagementTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

namespace Microsoft.Azure.Functions.PowerShellWorker.Test
{
using System.Diagnostics;
using System.Linq;
using System.Management.Automation;
using System.Threading;

public class DependencyManagementTests : IDisposable
{
Expand Down Expand Up @@ -481,8 +483,12 @@ public void SaveModule(PowerShell pwsh, string moduleName, string version, strin
{
if (SuccessfulDownload || (SaveModuleCount >= ShouldNotThrowAfterCount))
{
var stopwatch = new Stopwatch();
stopwatch.Start();
Thread.Sleep(10); // wait for 10 milliseconds

// Save the module name and version for a successful download.
DownloadedModuleInfo = string.Format(PowerShellWorkerStrings.ModuleHasBeenInstalled, moduleName, version);
DownloadedModuleInfo = string.Format(PowerShellWorkerStrings.ModuleHasBeenInstalled, moduleName, version, stopwatch.ElapsedMilliseconds);
return;
}

Expand Down