add upload times

This commit is contained in:
2026-08-06 13:17:29 -05:00
parent 3b54437269
commit c5da73d0ec
2 changed files with 35 additions and 24 deletions
+19
View File
@@ -0,0 +1,19 @@
using System.Collections.Concurrent;
using System.Numerics;
namespace SafelyYou;
public sealed class UploadTimes
{
private readonly ConcurrentDictionary<DeviceId, (BigInteger TotalUploadTime, int UploadCounts)> _uploadHistories = new();
public void Add(DeviceId deviceId, BigInteger uploadTimeNanos)
{
if (!_uploadHistories.TryGetValue(deviceId, out var history))
{
history = (BigInteger.Zero, 0);
}
_uploadHistories[deviceId] = (history.TotalUploadTime + uploadTimeNanos, history.UploadCounts + 1);
}
}