Fix endpoint usage parsing to show actual endpoints instead of HTTP methods

- Parse column 3 (endpoint path) instead of column 2 (HTTP method)
- Combine method and endpoint for clarity (e.g., 'GET users/{userId}')
- Now shows meaningful endpoint statistics instead of just GET/POST counts
This commit is contained in:
2026-02-07 17:54:35 -05:00
parent 248ab804f3
commit 56f2eca867

View File

@@ -2700,7 +2700,11 @@ public class AdminController : ControllerBase
if (parts.Length >= 3)
{
var timestamp = parts[0];
var endpoint = parts[1];
var method = parts[1];
var endpoint = parts[2];
// Combine method and endpoint for better clarity
var fullEndpoint = $"{method} {endpoint}";
// Filter by date if specified
if (sinceDate.HasValue && DateTime.TryParse(timestamp, out var logDate))
@@ -2709,7 +2713,7 @@ public class AdminController : ControllerBase
continue;
}
usage[endpoint] = usage.GetValueOrDefault(endpoint, 0) + 1;
usage[fullEndpoint] = usage.GetValueOrDefault(fullEndpoint, 0) + 1;
}
}