From 3dcbfdac63153fb69cef1934232d5617ee93584e Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 7 Apr 2026 11:32:18 +0200 Subject: [PATCH] correzioni metodi x compilare --- MP.Data/DbModels/Utils/StatsAggregatedModel.cs | 8 ++++++++ MP.Data/DbModels/Utils/StatsDetailModel.cs | 4 ++-- MP.IOC/Services/MetricsDbFlushService.cs | 10 +++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/MP.Data/DbModels/Utils/StatsAggregatedModel.cs b/MP.Data/DbModels/Utils/StatsAggregatedModel.cs index aa64a2ff..59501f32 100644 --- a/MP.Data/DbModels/Utils/StatsAggregatedModel.cs +++ b/MP.Data/DbModels/Utils/StatsAggregatedModel.cs @@ -16,6 +16,14 @@ namespace MP.Data.DbModels.Utils [Key] public int Id { get; set; } /// + /// Ambiente IOC/IO (new/old) + /// + public string Environment { get; set; } = ""; + /// + /// Codice tipo (metodo chiamato) + /// + public string Type { get; set; } = ""; + /// /// DataOra riferimento /// public DateTime Hour { get; set; } diff --git a/MP.Data/DbModels/Utils/StatsDetailModel.cs b/MP.Data/DbModels/Utils/StatsDetailModel.cs index 34ba8010..0b3744b4 100644 --- a/MP.Data/DbModels/Utils/StatsDetailModel.cs +++ b/MP.Data/DbModels/Utils/StatsDetailModel.cs @@ -16,11 +16,11 @@ namespace MP.Data.DbModels.Utils [Key] public int Id { get; set; } /// - /// Ambiente + /// Ambiente IOC/IO (new/old) /// public string Environment { get; set; } = ""; /// - /// Codice mode/submode + /// Codice tipo (metodo chiamato) /// public string Type { get; set; } = ""; /// diff --git a/MP.IOC/Services/MetricsDbFlushService.cs b/MP.IOC/Services/MetricsDbFlushService.cs index 99a1be1d..96eb8bf3 100644 --- a/MP.IOC/Services/MetricsDbFlushService.cs +++ b/MP.IOC/Services/MetricsDbFlushService.cs @@ -73,7 +73,7 @@ namespace MP.IOC.Services var aggRange = new DtUtils.Periodo(DtUtils.PeriodSet.Today) { - Inicio = thirtyDaysAgo, + Inizio = thirtyDaysAgo, Fine = utcNow }; @@ -147,7 +147,7 @@ namespace MP.IOC.Services var allKeys = await _db.SortedSetRangeByRankAsync(hoursIndexKey, 0, -1); foreach (var key in allKeys) { - if (key == null) continue; + if (!key.HasValue) continue; var hourFromKey = ExtractHourFromKey(key); if (hourFromKey.HasValue && hourFromKey.Value < cutoff) { @@ -168,7 +168,7 @@ namespace MP.IOC.Services var allKeys = await _db.SortedSetRangeByRankAsync(daysIndexKey, 0, -1); foreach (var key in allKeys) { - if (key == null) continue; + if (!key.HasValue) continue; var dayFromKey = ExtractDayFromKey(key); if (dayFromKey.HasValue && dayFromKey.Value.Date < cutoff.Date) { @@ -248,8 +248,6 @@ namespace MP.IOC.Services RequestCount = count, AvgDuration = avgDuration, MaxDuration = totalMs, - Perc05Duration = 0, - Perc95Duration = 0, MinDuration = 0, NoReply = 0 }; @@ -266,8 +264,6 @@ namespace MP.IOC.Services RequestCount = dest.Value, AvgDuration = totalMs / dest.Value, MaxDuration = totalMs, - Perc05Duration = 0, - Perc95Duration = 0, MinDuration = 0, NoReply = 0 };