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

Last change on this file since 298 was 279, checked in by alloc, 8 years ago

Mod stuff

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