Skip to content

Commit

Permalink
Small fix for wrong stats config
Browse files Browse the repository at this point in the history
  • Loading branch information
Splamy committed Mar 16, 2020
1 parent 9616229 commit 1462b0d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion TS3AudioBot/Environment/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Stats
private const string StatsTable = "stats";
private const int StatsVersion = 1;
private static readonly TimeSpan CheckInterval = TimeSpan.FromMinutes(1);
private static readonly TimeSpan SendInterval = TimeSpan.FromMinutes(2);
private static readonly TimeSpan SendInterval = TimeSpan.FromDays(1);
private static readonly JsonSerializerSettings JsonSettings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
Expand Down Expand Up @@ -136,9 +136,16 @@ private StatsPing GetStatsTill(DateTime date)
Runtime = SystemData.RuntimeData.FullName,
};

uint count = 0;
uint avgBots = 0;
var entries = trackEntries.Find(x => x.Time > date);
foreach (var entry in entries)
{
count++;
sendPacket.Add(entry);
avgBots += entry.RunningBots;
}
sendPacket.RunningBots = avgBots / count;
return sendPacket;
}

Expand Down

0 comments on commit 1462b0d

Please sign in to comment.