aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Telemetry/Types
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-12-01 16:37:45 -0600
committerJP Dillingham <jp@dillingham.me>2025-12-01 16:37:45 -0600
commit1f2556793d5b2e9f3ace545d43a7c3e6ea865104 (patch)
treeae5fa72dfa613c3467a4c5c2104cc95b3c279fbb /src/slskd/Telemetry/Types
parent5f21eaf17493d7c167e00bd833393227d7cace9e (diff)
downloadslskd-1f2556793d5b2e9f3ace545d43a7c3e6ea865104.tar.gz
implement user details
Diffstat (limited to 'src/slskd/Telemetry/Types')
-rw-r--r--src/slskd/Telemetry/Types/UserDirectionTransferSummary.cs39
-rw-r--r--src/slskd/Telemetry/Types/UserSummary.cs66
2 files changed, 39 insertions, 66 deletions
diff --git a/src/slskd/Telemetry/Types/UserDirectionTransferSummary.cs b/src/slskd/Telemetry/Types/UserDirectionTransferSummary.cs
new file mode 100644
index 00000000..2e517be7
--- /dev/null
+++ b/src/slskd/Telemetry/Types/UserDirectionTransferSummary.cs
@@ -0,0 +1,39 @@
+// <copyright file="UserDirectionTransferSummary.cs" company="slskd Team">
+// Copyright (c) slskd Team. All rights reserved.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see https://www.gnu.org/licenses/.
+// </copyright>
+
+namespace slskd.Telemetry;
+
+using System.Collections.Generic;
+using Soulseek;
+
+public record UserDirectionTransferSummary
+{
+ public Dictionary<TransferStates, TransferSummary> Summary { get; init; }
+ public UserDirectionTransferStatistics Statistics { get; init; }
+ public List<TransferExceptionSummary> Exceptions { get; init; }
+}
+
+public record UserDirectionTransferStatistics
+{
+ public long Total { get; init; }
+ public long Successful { get; init; }
+ public long Errored { get; init; }
+ public long Cancelled { get; init; }
+ public double SuccessRate => Successful / (double)Total;
+ public double ErrorRate => Errored / (double)Total;
+ public double CancelRate => Cancelled / (double)Total;
+} \ No newline at end of file
diff --git a/src/slskd/Telemetry/Types/UserSummary.cs b/src/slskd/Telemetry/Types/UserSummary.cs
deleted file mode 100644
index 757b5ae7..00000000
--- a/src/slskd/Telemetry/Types/UserSummary.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// <copyright file="UserSummary.cs" company="slskd Team">
-// Copyright (c) slskd Team. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Affero General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Affero General Public License for more details.
-//
-// You should have received a copy of the GNU Affero General Public License
-// along with this program. If not, see https://www.gnu.org/licenses/.
-// </copyright>
-
-namespace slskd.Telemetry;
-
-using System.Collections.Generic;
-using Soulseek;
-
-public record UserSummary
-{
- public UserTransferSummary Transfers { get; init; }
-}
-
-public record UserTransferSummary
-{
- public UserTransferDirectionSummary Upload { get; init; }
- public UserTransferDirectionSummary Download { get; init; }
- public UserTransferRatios Ratios { get; init; }
- public Dictionary<TransferDirection, UserTransferErrorSummary> Errors { get; init; }
-}
-
-public record UserTransferRatios
-{
- public double Count { get; init; }
- public double TotalBytes { get; init; }
-}
-
-public record UserTransferDirectionSummary
-{
- public Dictionary<TransferStates, TransferSummary> Summary { get; init; }
- public List<UserTransferErrorSummary> Errors { get; init; }
- public UserTransferDirectionStatistics Statistics { get; init; }
-}
-
-public record UserTransferErrorSummary
-{
- public string Exception { get; init; }
- public long Count { get; init; }
-}
-
-public record UserTransferDirectionStatistics
-{
- public double SuccessRate { get; init; }
- public double ErrorRate { get; init; }
- public double CancelRate { get; init; }
-}
-
-public record UserMessageStatistics
-{
- public int Sent { get; init; }
- public int Received { get; init; }
-} \ No newline at end of file