Add clientstack.OutgoingUDPSendsCount stat to show number of outbound UDP packets sent by a region per second

cpu-performance
Justin Clark-Casey (justincc) 2013-07-23 00:15:58 +01:00
parent 0755fc2f65
commit 0d90834f86
2 changed files with 22 additions and 3 deletions

View File

@ -70,8 +70,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
StatsManager.RegisterStat( StatsManager.RegisterStat(
new Stat( new Stat(
"IncomingUDPReceivesCount", "IncomingUDPReceivesCount",
"Number of inbound LL protocol packets processed", "Number of UDP receives performed",
"Number of inbound LL protocol packets processed", "Number of UDP receives performed",
"", "",
"clientstack", "clientstack",
scene.Name, scene.Name,
@ -93,6 +93,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
stat => stat.Value = m_udpServer.IncomingPacketsProcessed, stat => stat.Value = m_udpServer.IncomingPacketsProcessed,
StatVerbosity.Debug)); StatVerbosity.Debug));
StatsManager.RegisterStat(
new Stat(
"OutgoingUDPSendsCount",
"Number of UDP sends performed",
"Number of UDP sends performed",
"",
"clientstack",
scene.Name,
StatType.Pull,
MeasuresOfInterest.AverageChangeOverTime,
stat => stat.Value = m_udpServer.UdpSends,
StatVerbosity.Debug));
StatsManager.RegisterStat( StatsManager.RegisterStat(
new Stat( new Stat(
"AverageUDPProcessTime", "AverageUDPProcessTime",
@ -856,7 +869,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
PacketPool.Instance.ReturnPacket(packet); PacketPool.Instance.ReturnPacket(packet);
m_dataPresentEvent.Set(); m_dataPresentEvent.Set();
} }
private AutoResetEvent m_dataPresentEvent = new AutoResetEvent(false); private AutoResetEvent m_dataPresentEvent = new AutoResetEvent(false);

View File

@ -82,6 +82,11 @@ namespace OpenMetaverse
/// </summary> /// </summary>
public int UdpReceives { get; private set; } public int UdpReceives { get; private set; }
/// <summary>
/// Number of UDP sends
/// </summary>
public int UdpSends { get; private set; }
/// <summary> /// <summary>
/// Number of receives over which to establish a receive time average. /// Number of receives over which to establish a receive time average.
/// </summary> /// </summary>
@ -381,6 +386,8 @@ namespace OpenMetaverse
{ {
// UDPPacketBuffer buf = (UDPPacketBuffer)result.AsyncState; // UDPPacketBuffer buf = (UDPPacketBuffer)result.AsyncState;
m_udpSocket.EndSendTo(result); m_udpSocket.EndSendTo(result);
UdpSends++;
} }
catch (SocketException) { } catch (SocketException) { }
catch (ObjectDisposedException) { } catch (ObjectDisposedException) { }