part 1
This commit is contained in:
parent
f06ab16a2f
commit
ae93d897e8
1
.gitignore
vendored
1
.gitignore
vendored
@ -36,3 +36,4 @@ Tests/
|
|||||||
!**/packages/build/
|
!**/packages/build/
|
||||||
# Uncomment if necessary however generally it will be regenerated when needed
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
#!**/packages/repositories.config
|
#!**/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",
|
Arguments = $"-i {SongInfo.Uri} -f s16le -ar 48000 -ac 2 pipe:1 -loglevel quiet",
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
||||||
|
RedirectStandardError = false,
|
||||||
|
CreateNoWindow = true,
|
||||||
});
|
});
|
||||||
int blockSize = 3840;
|
int blockSize = 3840;
|
||||||
byte[] buffer = new byte[blockSize];
|
byte[] buffer = new byte[blockSize];
|
||||||
@ -163,6 +165,8 @@ namespace NadekoBot.Classes.Music {
|
|||||||
finally {
|
finally {
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
p.CancelOutputRead();
|
p.CancelOutputRead();
|
||||||
|
p.StandardOutput.Dispose();
|
||||||
|
p.CloseMainWindow();
|
||||||
p.Close();
|
p.Close();
|
||||||
p.Dispose();
|
p.Dispose();
|
||||||
}
|
}
|
||||||
@ -178,7 +182,7 @@ namespace NadekoBot.Classes.Music {
|
|||||||
while (!prebufferingComplete && bufferAttempts++ < toAttemptTimes) {
|
while (!prebufferingComplete && bufferAttempts++ < toAttemptTimes) {
|
||||||
await Task.Delay(waitPerAttempt);
|
await Task.Delay(waitPerAttempt);
|
||||||
}
|
}
|
||||||
Console.WriteLine($"Prebuffering done? in {waitPerAttempt*bufferAttempts}");
|
Console.WriteLine($"Prebuffering done? in {waitPerAttempt * bufferAttempts}");
|
||||||
int blockSize = 3840;
|
int blockSize = 3840;
|
||||||
byte[] buffer = new byte[blockSize];
|
byte[] buffer = new byte[blockSize];
|
||||||
int attempt = 0;
|
int attempt = 0;
|
||||||
|
@ -108,13 +108,15 @@ namespace NadekoBot {
|
|||||||
sb.Append($" | TextChannels: {TextChannelsCount}");
|
sb.Append($" | TextChannels: {TextChannelsCount}");
|
||||||
sb.AppendLine($" | VoiceChannels: {VoiceChannelsCount}`");
|
sb.AppendLine($" | VoiceChannels: {VoiceChannelsCount}`");
|
||||||
//$"\nUsers: {_client.Servers.SelectMany(x => x.Users.Select(y => y.Id)).Count()} (non-unique)" +
|
//$"\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($"`Commands Ran this session: {_commandsRan}`");
|
||||||
sb.AppendLine($"`Message queue size:{_client.MessageQueue.Count}`");
|
sb.AppendLine($"`Message queue size:{_client.MessageQueue.Count}`");
|
||||||
sb.AppendLine($"`Greeted {Commands.ServerGreetCommand.Greeted} times.`");
|
sb.AppendLine($"`Greeted {Commands.ServerGreetCommand.Greeted} times.`");
|
||||||
_statsCache = sb.ToString();
|
_statsCache = sb.ToString();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
public string Heap() => Math.Round((double)GC.GetTotalMemory(true) / 1.MiB(), 2).ToString();
|
||||||
|
|
||||||
public async Task<string> GetStats() {
|
public async Task<string> GetStats() {
|
||||||
if (_statsSW.Elapsed.Seconds > 5) {
|
if (_statsSW.Elapsed.Seconds > 5) {
|
||||||
await LoadStats();
|
await LoadStats();
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user