Skip to content

Commit 548704c

Browse files
committed
Add PSSA duration to log message
1 parent f505907 commit 548704c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PowerShellEditorServices/Services/Analysis/PssaCmdletAnalysisEngine.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections;
66
using System.Collections.Generic;
77
using System.Collections.ObjectModel;
8+
using System.Diagnostics;
89
using System.Linq;
910
using System.Text;
1011
using System.Threading.Tasks;
@@ -252,10 +253,12 @@ public void Dispose() =>
252253

253254
private async Task<ScriptFileMarker[]> GetSemanticMarkersFromCommandAsync(PSCommand command)
254255
{
256+
Stopwatch stopwatch = Stopwatch.StartNew();
255257
PowerShellResult result = await InvokePowerShellAsync(command).ConfigureAwait(false);
258+
stopwatch.Stop();
256259

257260
IReadOnlyCollection<PSObject> diagnosticResults = result?.Output ?? s_emptyDiagnosticResult;
258-
_logger.LogDebug(string.Format("Found {0} violations", diagnosticResults.Count));
261+
_logger.LogDebug(string.Format("Found {0} violations in {1}ms", diagnosticResults.Count, stopwatch.ElapsedMilliseconds));
259262

260263
ScriptFileMarker[] scriptMarkers = new ScriptFileMarker[diagnosticResults.Count];
261264
int i = 0;

0 commit comments

Comments
 (0)