source: binary-improvements/MapRendering/Commands/webstat.cs@ 451

Last change on this file since 451 was 420, checked in by alloc, 20 months ago

A21 preparations.
NOT COMPATIBLE WITH A20 ANYMORE!

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