CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.net
Class DatagramTest.PacketTracker

java.lang.Object
  extended by com.tangosol.net.DatagramTest.PacketTracker
Enclosing class:
DatagramTest

protected static class DatagramTest.PacketTracker
extends Object

Tracker of packet statistics for a single client.


Field Summary
protected  SocketAddress m_addrSender
           
protected  long m_cBytesReceived
           
protected  long m_cGapMillis
           
protected  long m_cGapPackets
           
protected  long m_cGaps
           
protected  int m_cOutOfOrder
           
protected  int m_cPacketsRcvd
           
protected  long m_cTotalOutOfOrderOffset
           
protected  long m_lLastPacketArrivalTime
           
protected  long m_lStartTime
           
protected  int m_nMax
           
protected  int m_nMin
           
protected  int m_nNext
           
 
Constructor Summary
DatagramTest.PacketTracker(SocketAddress addrSender)
          Construct a PacketTracker for the given client.
 
Method Summary
 long computeAverageOutOfOrderOffset()
          Compute the average out of order offset for packets which arrived out of order.
 int computeAveragePacketSize()
          Compute average packet size.
 long computeDurationMillis()
          Return the duration this tracker has been accumulating data for.
 int computeMissingPackets()
          Compute the number of missing packets.
 int computeSentPackets()
          Compute the number of packets sent by the publisher.
 float computeSuccessRate()
          Compute the success rate for receiveing packets.
 int computeThroughputMBPerSec()
          Compute the throughput in megabytes per second.
 int computeThroughputPacketsPerSec()
          Compute the throughput in megabytes per second.
static void generateReport(String sPeriod, Map mapTracker)
          Generate a report for all PacketTrackers in the Map.
 String getTabularReport()
          Return a report in tabular form.
static String getTabularReportHeader()
          Return a header for a tabular report.
 void reset(long lTimeMs)
          Reset the counters.
 String toString()
          Return a human readable report on the tracked data.
static String toString(DatagramTest.PacketTracker[] aTracker)
          Return a summay report on multiple trackers.
 void trackArrival(int nCurrent, int cBytes)
          Track the arrival of a new packet.
 

Field Detail

m_addrSender

protected SocketAddress m_addrSender

m_cPacketsRcvd

protected int m_cPacketsRcvd

m_lStartTime

protected long m_lStartTime

m_lLastPacketArrivalTime

protected long m_lLastPacketArrivalTime

m_nMin

protected int m_nMin

m_nMax

protected int m_nMax

m_nNext

protected int m_nNext

m_cOutOfOrder

protected int m_cOutOfOrder

m_cTotalOutOfOrderOffset

protected long m_cTotalOutOfOrderOffset

m_cBytesReceived

protected long m_cBytesReceived

m_cGaps

protected long m_cGaps

m_cGapPackets

protected long m_cGapPackets

m_cGapMillis

protected long m_cGapMillis
Constructor Detail

DatagramTest.PacketTracker

public DatagramTest.PacketTracker(SocketAddress addrSender)
Construct a PacketTracker for the given client.

Parameters:
addrSender - the address of the client
Method Detail

trackArrival

public void trackArrival(int nCurrent,
                         int cBytes)
Track the arrival of a new packet.

Parameters:
nCurrent - packet number
cBytes - packet size in bytes

reset

public void reset(long lTimeMs)
Reset the counters.

Parameters:
lTimeMs - the current time

computeDurationMillis

public long computeDurationMillis()
Return the duration this tracker has been accumulating data for.

Returns:
duration in milliseconds

computeSentPackets

public int computeSentPackets()
Compute the number of packets sent by the publisher.

Returns:
the number of packets sent by the publisher

computeMissingPackets

public int computeMissingPackets()
Compute the number of missing packets.

Returns:
the number of missing packets

computeAverageOutOfOrderOffset

public long computeAverageOutOfOrderOffset()
Compute the average out of order offset for packets which arrived out of order.

Returns:
the average out of order offset

computeSuccessRate

public float computeSuccessRate()
Compute the success rate for receiveing packets.

Returns:
the success rate

computeThroughputMBPerSec

public int computeThroughputMBPerSec()
Compute the throughput in megabytes per second.

Returns:
return the computed throughput

computeThroughputPacketsPerSec

public int computeThroughputPacketsPerSec()
Compute the throughput in megabytes per second.

Returns:
return the computed throughput

computeAveragePacketSize

public int computeAveragePacketSize()
Compute average packet size.

Returns:
the average packet size received

getTabularReportHeader

public static String getTabularReportHeader()
Return a header for a tabular report.

Returns:
a tabular report header

getTabularReport

public String getTabularReport()
Return a report in tabular form.

Returns:
a report in tabular form

toString

public String toString()
Return a human readable report on the tracked data.

Returns:
a human readable report

toString

public static String toString(DatagramTest.PacketTracker[] aTracker)
Return a summay report on multiple trackers.

Parameters:
aTracker - an array of trackers which ran concurrently

generateReport

public static void generateReport(String sPeriod,
                                  Map mapTracker)
Generate a report for all PacketTrackers in the Map.

Parameters:
sPeriod - description of the period the results cover
mapTracker - the map of trackers

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation