part 1
This commit is contained in:
parent
f06ab16a2f
commit
ae93d897e8
1
.gitignore
vendored
1
.gitignore
vendored
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
@ -178,7 +182,7 @@ namespace NadekoBot.Classes.Music {
|
||||
while (!prebufferingComplete && bufferAttempts++ < toAttemptTimes) {
|
||||
await Task.Delay(waitPerAttempt);
|
||||
}
|
||||
Console.WriteLine($"Prebuffering done? in {waitPerAttempt*bufferAttempts}");
|
||||
Console.WriteLine($"Prebuffering done? in {waitPerAttempt * bufferAttempts}");
|
||||
int blockSize = 3840;
|
||||
byte[] buffer = new byte[blockSize];
|
||||
int attempt = 0;
|
||||
|
@ -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();
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user