aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Telemetry/API
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-06-17 22:04:32 -0500
committerJP Dillingham <jp@dillingham.me>2026-06-17 22:04:32 -0500
commitc292d3db3fd96a72b1be8041d4233ea6e70b1f00 (patch)
treec07bedf2df354018c988c224f0425779311fe9a0 /src/slskd/Telemetry/API
parent7f3dbabb059fc3c90de6d13e51e68a39be1a56e5 (diff)
downloadslskd-c292d3db3fd96a72b1be8041d4233ea6e70b1f00.tar.gz
wip
Diffstat (limited to 'src/slskd/Telemetry/API')
-rw-r--r--src/slskd/Telemetry/API/MetricsHub.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/slskd/Telemetry/API/MetricsHub.cs b/src/slskd/Telemetry/API/MetricsHub.cs
index 889636cc..d8692755 100644
--- a/src/slskd/Telemetry/API/MetricsHub.cs
+++ b/src/slskd/Telemetry/API/MetricsHub.cs
@@ -32,6 +32,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.SignalR;
+using Serilog;
namespace slskd.Telemetry;
@@ -44,7 +45,7 @@ public static class MetricsHubExtensions
{
public static Task BroadcastTransferMetrics(this IHubContext<MetricsHub> hub)
{
- return hub.Clients.All.SendAsync(MetricsHubMethods.Transfers, new { });
+ return hub.Clients.All.SendAsync(MetricsHubMethods.Transfers, MetricsHub.GetMetrics());
}
}
@@ -52,7 +53,6 @@ public class MetricsHub : Hub
{
public MetricsHub()
{
- Clock.EverySecond += (_, _) => Clients.All.SendAsync(MetricsHubMethods.Transfers, GetMetrics());
}
public override async Task OnConnectedAsync()
@@ -60,9 +60,11 @@ public class MetricsHub : Hub
await Clients.Caller.SendAsync(MetricsHubMethods.Transfers, GetMetrics());
}
- private object GetMetrics()
+ private static ILogger Log { get; } = Serilog.Log.ForContext<MetricsHub>();
+
+ public static object GetMetrics()
{
- return new
+ var metrics = new
{
Downloads = new
{
@@ -95,5 +97,8 @@ public class MetricsHub : Hub
},
},
};
+
+ Log.Warning("{Metrics}", metrics);
+ return metrics;
}
} \ No newline at end of file