diff --git a/MP.IOC/Services/RouteManager.cs b/MP.IOC/Services/RouteManager.cs
index d51a57d6..444f9acc 100644
--- a/MP.IOC/Services/RouteManager.cs
+++ b/MP.IOC/Services/RouteManager.cs
@@ -102,9 +102,11 @@ namespace MP.IOC.Services
try
{
-#if false
+ string sKey = $"{target}|{metodo}";
// Registra scelta
- _stats.Record(metodo, target);
+ _stats.Record(sKey);
+#if false
+ _stats.Record(metodo, target);
#endif
// imposta la Path che vogliamo che YARP appenda al destBase
@@ -118,7 +120,6 @@ namespace MP.IOC.Services
var error = await _forwarder.SendAsync(context, destBase, _httpClientInvoker, requestOptions, _transformer, context.RequestAborted);
sw.Stop();
- string sKey = $"{target}|{metodo}";
_stats.RecordDuration(sKey, sw.Elapsed);
#if false
_stats.RecordDuration(metodo, sw.Elapsed);
diff --git a/MP.IOC/Services/RouteStatsManager.cs b/MP.IOC/Services/RouteStatsManager.cs
index 756a2f54..988abbad 100644
--- a/MP.IOC/Services/RouteStatsManager.cs
+++ b/MP.IOC/Services/RouteStatsManager.cs
@@ -41,8 +41,17 @@ namespace MP.IOC.Services
var destStat = stat.Destinations.GetOrAdd(destination, _ => new DestinationStats());
Interlocked.Increment(ref destStat.Count);
- }
+ }
#endif
+ ///
+ /// Registrazione del metodo + destinazione
+ ///
+ ///
+ public void Record(string dest_method)
+ {
+ var stat = _map.GetOrAdd(dest_method, _ => new RouteStats());
+ Interlocked.Increment(ref stat.Count);
+ }
///
/// Registrazione destinazione+metodo
@@ -55,7 +64,6 @@ namespace MP.IOC.Services
{
lock (stat)
{
- stat.Count += 1;
stat.TotalDuration += duration;
if (stat.MaxDuration < duration)