|
Last change
on this file since 440 was 420, checked in by alloc, 3 years ago |
|
A21 preparations.
NOT COMPATIBLE WITH A20 ANYMORE!
|
|
File size:
1.4 KB
|
| Line | |
|---|
| 1 | using System;
|
|---|
| 2 | using System.Collections.Generic;
|
|---|
| 3 | using AllocsFixes.NetConnections.Servers.Web;
|
|---|
| 4 |
|
|---|
| 5 | namespace 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.