duration of scan

This commit is contained in:
Volodymyr Smirnov
2020-10-27 21:40:34 +02:00
parent 2a933ebe6b
commit b3fc7ff2d9
9 changed files with 40 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using EasyNetQ;
@@ -61,6 +62,10 @@ namespace MalwareMultiScan.Scanner.Services
Id = message.Id,
Backend = _backend.Id
};
var stopwatch = new Stopwatch();
stopwatch.Start();
try
{
@@ -80,6 +85,12 @@ namespace MalwareMultiScan.Scanner.Services
_logger.LogError(
exception, "Scanning failed with exception");
}
finally
{
stopwatch.Stop();
}
result.Duration = stopwatch.ElapsedMilliseconds / 1000;
_logger.LogInformation(
$"Sending scan results with status {result.Succeeded}");