mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-10-11 04:26:16 +00:00
duration of scan
This commit is contained in:
@@ -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}");
|
||||
|
Reference in New Issue
Block a user