Last change
on this file since 420 was 420, checked in by alloc, 20 months ago |
A21 preparations.
NOT COMPATIBLE WITH A20 ANYMORE!
|
File size:
1.4 KB
|
Rev | Line | |
---|
[230] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
[325] | 3 | using AllocsFixes.NetConnections.Servers.Web;
|
---|
[230] | 4 |
|
---|
[325] | 5 | namespace AllocsFixes.CustomCommands {
|
---|
| 6 | public class webstat : ConsoleCmdAbstract {
|
---|
[420] | 7 | protected override string getDescription () {
|
---|
[230] | 8 | return "DEBUG PURPOSES ONLY";
|
---|
| 9 | }
|
---|
| 10 |
|
---|
[420] | 11 | protected override string[] getCommands () {
|
---|
| 12 | return new[] {"webstat_legacy"};
|
---|
[230] | 13 | }
|
---|
| 14 |
|
---|
[325] | 15 | public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
|
---|
[359] | 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");
|
---|
[279] | 22 |
|
---|
[359] | 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 | : ""));
|
---|
[230] | 32 | }
|
---|
| 33 | }
|
---|
[325] | 34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.