source: binary-improvements2/MapRendering/Commands/webstat.cs@ 389

Last change on this file since 389 was 383, checked in by alloc, 2 years ago

Fixed a bunch of warnings

File size: 1.3 KB
Line 
1using System.Collections.Generic;
2using AllocsFixes.NetConnections.Servers.Web;
3
4namespace AllocsFixes.CustomCommands {
5 public class webstat : ConsoleCmdAbstract {
6 public override string GetDescription () {
7 return "DEBUG PURPOSES ONLY";
8 }
9
10 public override string[] GetCommands () {
11 return new[] {"webstat"};
12 }
13
14 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
15 int curHandlers = Web.currentHandlers;
16 int totalHandlers = Web.handlingCount;
17 long totalTime = Web.totalHandlingTime;
18 SdtdConsole.Instance.Output ("Current Web handlers: " + curHandlers + " - total: " + totalHandlers);
19 SdtdConsole.Instance.Output (" - Total time: " + totalTime + " µs - average time: " +
20 totalTime / totalHandlers + " µs");
21
22 curHandlers = WebCommandResult.currentHandlers;
23 totalHandlers = WebCommandResult.handlingCount;
24 totalTime = WebCommandResult.totalHandlingTime;
25 SdtdConsole.Instance.Output ("Current Web command handlers: " + curHandlers + " - total: " +
26 totalHandlers);
27 SdtdConsole.Instance.Output (" - Total time: " + totalTime + " µs" +
28 (totalHandlers > 0
29 ? " - average time: " + totalTime / totalHandlers + " µs"
30 : ""));
31 }
32 }
33}
Note: See TracBrowser for help on using the repository browser.