diff --git a/MP.IOC/Controllers/IOBController.cs b/MP.IOC/Controllers/IOBController.cs index a15d6427..9d5bed28 100644 --- a/MP.IOC/Controllers/IOBController.cs +++ b/MP.IOC/Controllers/IOBController.cs @@ -6,6 +6,7 @@ using MP.Data.Services.IOC; using MP.IOC.Data; using Newtonsoft.Json; using NLog; +using System.Diagnostics; using System.Reflection; using static MP.Core.Objects.Enums; @@ -874,16 +875,23 @@ namespace MP.IOC.Controllers if (string.IsNullOrEmpty(id)) return BadRequest("Missing ID"); string answ = ""; - if (string.IsNullOrEmpty(cnt)) - { - cnt = "0"; - } + cnt = string.IsNullOrEmpty(cnt) ? "0" : cnt; - DateTime dataOraEvento = DateTime.Now; try { + Stopwatch sw = new Stopwatch(); + sw.Start(); answ = await IOCService.ProcessInputAsync(id, valore, dtEve, dtCurr, cnt); //answ = await DService.ProcessInputAsync(id, valore, dtEve, dtCurr, cnt); + sw.Stop(); + if (sw.Elapsed.TotalMilliseconds > 15) + { + Log.Info($"Input | elapsed: {sw.Elapsed.TotalMilliseconds:N1} | id: {id} | val: {valore} | cnt: {cnt}"); + } + else + { + Log.Debug($"Input | elapsed: {sw.Elapsed.TotalMilliseconds:N1} | id: {id} | val: {valore} | cnt: {cnt}"); + } return Ok(answ); } catch (Exception exc)