restructured and extended performance diagnostics to cover gump and target responses
This commit is contained in:
parent
a8d3bcbec9
commit
5c64b1754c
12 changed files with 569 additions and 401 deletions
|
|
@ -32,6 +32,7 @@ using Server.Items;
|
|||
using Server.Gumps;
|
||||
using Server.Menus;
|
||||
using Server.HuePickers;
|
||||
using Server.Diagnostics;
|
||||
|
||||
namespace Server.Network {
|
||||
public interface IPacketEncoder {
|
||||
|
|
@ -534,8 +535,7 @@ namespace Server.Network {
|
|||
return;
|
||||
}
|
||||
|
||||
PacketProfile prof = PacketProfile.GetOutgoingProfile( ( byte ) p.PacketID );
|
||||
DateTime start = ( prof == null ? DateTime.MinValue : DateTime.Now );
|
||||
PacketSendProfile prof = PacketSendProfile.Acquire( p.GetType() );
|
||||
|
||||
int length;
|
||||
byte[] buffer = p.Compile( m_CompressionEnabled, out length );
|
||||
|
|
@ -546,6 +546,10 @@ namespace Server.Network {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( prof != null ) {
|
||||
prof.Start();
|
||||
}
|
||||
|
||||
if ( m_Encoder != null ) {
|
||||
m_Encoder.EncodeOutgoingPacket( this, ref buffer, ref length );
|
||||
}
|
||||
|
|
@ -572,7 +576,7 @@ namespace Server.Network {
|
|||
p.OnSend();
|
||||
|
||||
if ( prof != null ) {
|
||||
prof.Record( length, DateTime.Now - start );
|
||||
prof.Finish( length );
|
||||
}
|
||||
} else {
|
||||
Console.WriteLine( "Client: {0}: null buffer send, disconnecting...", this );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue