This commit is contained in:
Master Kwoth 2016-02-29 07:15:03 +01:00
parent f06ab16a2f
commit ae93d897e8
4 changed files with 9 additions and 2 deletions

1
.gitignore vendored
View File

@ -36,3 +36,4 @@ Tests/
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
NadekoBot/bin/Debug/data/nadekobot.sqlite

View File

@ -142,6 +142,8 @@ namespace NadekoBot.Classes.Music {
Arguments = $"-i {SongInfo.Uri} -f s16le -ar 48000 -ac 2 pipe:1 -loglevel quiet",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = false,
CreateNoWindow = true,
});
int blockSize = 3840;
byte[] buffer = new byte[blockSize];
@ -163,6 +165,8 @@ namespace NadekoBot.Classes.Music {
finally {
if (p != null) {
p.CancelOutputRead();
p.StandardOutput.Dispose();
p.CloseMainWindow();
p.Close();
p.Dispose();
}

View File

@ -108,13 +108,15 @@ namespace NadekoBot {
sb.Append($" | TextChannels: {TextChannelsCount}");
sb.AppendLine($" | VoiceChannels: {VoiceChannelsCount}`");
//$"\nUsers: {_client.Servers.SelectMany(x => x.Users.Select(y => y.Id)).Count()} (non-unique)" +
sb.AppendLine($"`Heap: {Math.Round((double)GC.GetTotalMemory(false) / 1.MiB(), 2).ToString()} MB`");
//sb.AppendLine($"`Heap: {} MB`");
sb.AppendLine($"`Commands Ran this session: {_commandsRan}`");
sb.AppendLine($"`Message queue size:{_client.MessageQueue.Count}`");
sb.AppendLine($"`Greeted {Commands.ServerGreetCommand.Greeted} times.`");
_statsCache = sb.ToString();
});
public string Heap() => Math.Round((double)GC.GetTotalMemory(true) / 1.MiB(), 2).ToString();
public async Task<string> GetStats() {
if (_statsSW.Elapsed.Seconds > 5) {
await LoadStats();