Changeset 325 for binary-improvements/MapRendering/Commands/webstat.cs
- Timestamp:
- Sep 4, 2018, 1:00:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Commands/webstat.cs
r279 r325 1 1 using System; 2 2 using System.Collections.Generic; 3 using AllocsFixes.NetConnections.Servers.Web; 3 4 4 namespace AllocsFixes.CustomCommands 5 { 6 public class webstat : ConsoleCmdAbstract 7 { 8 public override string GetDescription () 9 { 5 namespace AllocsFixes.CustomCommands { 6 public class webstat : ConsoleCmdAbstract { 7 public override string GetDescription () { 10 8 return "DEBUG PURPOSES ONLY"; 11 9 } 12 10 13 public override string[] GetCommands () 14 { 15 return new string[] { "webstat" }; 11 public override string[] GetCommands () { 12 return new[] {"webstat"}; 16 13 } 17 14 18 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 19 { 15 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) { 20 16 try { 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;17 int curHandlers = Web.currentHandlers; 18 int totalHandlers = Web.handlingCount; 19 long totalTime = Web.totalHandlingTime; 24 20 SdtdConsole.Instance.Output ("Current Web handlers: " + curHandlers + " - total: " + totalHandlers); 25 SdtdConsole.Instance.Output (" - Total time: " + totalTime + " µs - average time: " + (totalTime / totalHandlers) + " µs"); 21 SdtdConsole.Instance.Output (" - Total time: " + totalTime + " µs - average time: " + 22 totalTime / totalHandlers + " µs"); 26 23 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" : "")); 24 curHandlers = WebCommandResult.currentHandlers; 25 totalHandlers = WebCommandResult.handlingCount; 26 totalTime = WebCommandResult.totalHandlingTime; 27 SdtdConsole.Instance.Output ("Current Web command handlers: " + curHandlers + " - total: " + 28 totalHandlers); 29 SdtdConsole.Instance.Output (" - Total time: " + totalTime + " µs" + 30 (totalHandlers > 0 31 ? " - average time: " + totalTime / totalHandlers + " µs" 32 : "")); 32 33 } catch (Exception e) { 33 34 Log.Out ("Error in webstat.Run: " + e);
Note:
See TracChangeset
for help on using the changeset viewer.