| Rev | Line | |
|---|
| [230] | 1 | using System.Collections.Generic;
|
|---|
| [325] | 2 | using AllocsFixes.NetConnections.Servers.Web;
|
|---|
| [230] | 3 |
|
|---|
| [325] | 4 | namespace AllocsFixes.CustomCommands {
|
|---|
| 5 | public class webstat : ConsoleCmdAbstract {
|
|---|
| 6 | public override string GetDescription () {
|
|---|
| [230] | 7 | return "DEBUG PURPOSES ONLY";
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| [325] | 10 | public override string[] GetCommands () {
|
|---|
| 11 | return new[] {"webstat"};
|
|---|
| [230] | 12 | }
|
|---|
| 13 |
|
|---|
| [325] | 14 | public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
|
|---|
| [359] | 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");
|
|---|
| [279] | 21 |
|
|---|
| [359] | 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 | : ""));
|
|---|
| [230] | 31 | }
|
|---|
| 32 | }
|
|---|
| [325] | 33 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.