Added message counter and msg/sec
This commit is contained in:
parent
1a561ef62f
commit
4198201a18
@ -31,6 +31,9 @@ namespace NadekoBot
|
|||||||
private readonly Timer commandLogTimer = new Timer() { Interval = 10000 };
|
private readonly Timer commandLogTimer = new Timer() { Interval = 10000 };
|
||||||
private readonly Timer carbonStatusTimer = new Timer() { Interval = 3600000 };
|
private readonly Timer carbonStatusTimer = new Timer() { Interval = 3600000 };
|
||||||
|
|
||||||
|
private static ulong messageCounter = 0;
|
||||||
|
public static ulong MessageCounter => messageCounter;
|
||||||
|
|
||||||
static NadekoStats() { }
|
static NadekoStats() { }
|
||||||
|
|
||||||
private NadekoStats()
|
private NadekoStats()
|
||||||
@ -50,6 +53,8 @@ namespace NadekoBot
|
|||||||
TextChannelsCount = channelsArray.Count(c => c.Type == ChannelType.Text);
|
TextChannelsCount = channelsArray.Count(c => c.Type == ChannelType.Text);
|
||||||
VoiceChannelsCount = channelsArray.Count() - TextChannelsCount;
|
VoiceChannelsCount = channelsArray.Count() - TextChannelsCount;
|
||||||
|
|
||||||
|
NadekoBot.Client.MessageReceived += (s, e) => messageCounter++;
|
||||||
|
|
||||||
NadekoBot.Client.JoinedServer += (s, e) =>
|
NadekoBot.Client.JoinedServer += (s, e) =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -131,7 +136,7 @@ namespace NadekoBot
|
|||||||
|
|
||||||
public string GetUptimeString()
|
public string GetUptimeString()
|
||||||
{
|
{
|
||||||
var time = (DateTime.Now - Process.GetCurrentProcess().StartTime);
|
var time = GetUptime();
|
||||||
return time.Days + " days, " + time.Hours + " hours, and " + time.Minutes + " minutes.";
|
return time.Days + " days, " + time.Hours + " hours, and " + time.Minutes + " minutes.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +159,7 @@ namespace NadekoBot
|
|||||||
sb.Append($"`Greeted {ServerGreetCommand.Greeted} times.`");
|
sb.Append($"`Greeted {ServerGreetCommand.Greeted} times.`");
|
||||||
sb.AppendLine($" `| Playing {songs} songs, ".SnPl(songs) +
|
sb.AppendLine($" `| Playing {songs} songs, ".SnPl(songs) +
|
||||||
$"{MusicModule.MusicPlayers.Sum(kvp => kvp.Value.Playlist.Count)} queued.`");
|
$"{MusicModule.MusicPlayers.Sum(kvp => kvp.Value.Playlist.Count)} queued.`");
|
||||||
sb.AppendLine($"`Heap: {Heap(false)}`");
|
sb.AppendLine($"`Messages: {messageCounter} ({messageCounter / (double)GetUptime().TotalSeconds:F2}/sec)` `Heap: {Heap(false)}`");
|
||||||
statsCache = sb.ToString();
|
statsCache = sb.ToString();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user