Files
libremetaverse/libsecondlife/examples/TestClient/Commands/StatsCommand.cs
John Hurliman 81472d88f4 * Incoming packets are put on a queue instead of processing immediately
* Two new classes added, a ManagedThreadPool that is a performance enhanced ThreadPool, and BlockingQueue which is a thread-safe queue that allows one end to block until something is added to the queue
* Added Simulator.ReceivedResends for tracking the number of resent packets received
* Added StatsCommand to TestClient to print out basic networking stats

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1101 52acb1d6-8a22-11de-b505-999d5b087335
2007-04-03 05:47:09 +00:00

40 lines
1.2 KiB
C#

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();
}
}
}