From 5b6afeafbc249ba88dcc20d1fbc98ce12418b21b Mon Sep 17 00:00:00 2001 From: gareth Date: Tue, 8 May 2007 00:10:04 +0000 Subject: Brought in TestClient code for teh fork --- ExportBot/Commands/StatsCommand.cs | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ExportBot/Commands/StatsCommand.cs (limited to 'ExportBot/Commands/StatsCommand.cs') diff --git a/ExportBot/Commands/StatsCommand.cs b/ExportBot/Commands/StatsCommand.cs new file mode 100644 index 0000000..7835ec8 --- /dev/null +++ b/ExportBot/Commands/StatsCommand.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; + +namespace libsecondlife.TestClient +{ + public class StatsCommand : Command + { + public StatsCommand(TestClient testClient) + { + Name = "stats"; + Description = "Provide connection figures and statistics"; + } + + public override string Execute(string[] args, LLUUID fromAgentID) + { + StringBuilder output = new StringBuilder(); + + lock (Client.Network.Simulators) + { + for (int i = 0; i < Client.Network.Simulators.Count; i++) + { + Simulator sim = Client.Network.Simulators[i]; + + output.AppendLine(String.Format( + "[{0}] Dilation: {1} InBPS: {2} OutBPS: {3} ResentOut: {4} ResentIn: {5}", + sim.ToString(), sim.Dilation, sim.IncomingBPS, sim.OutgoingBPS, sim.ResentPackets, + sim.ReceivedResends)); + } + } + + output.Append("Packets in the queue: " + Client.Network.InboxCount); + + return output.ToString(); + } + } +} -- cgit v1.1