com.nexaweb.server.pushconnection
Class ConnectionStatistics

java.lang.Object
  extended bycom.nexaweb.server.pushconnection.ConnectionStatistics

public class ConnectionStatistics
extends java.lang.Object

This object keeps statistics on the data flowing over a PushConnection. This information can be used to determine what FlushPolicy will best suit your needs. The statistics may be obtained individually from the get methods or XML reports may be obtained.

Single Object Report Example XML

    <ConnectionStatistics sessionId="xxxxxx">
        <TotalBytesSent>51920</TotalBytesSent>
        <TotalCommunicationBytes>51920</TotalCommunicationBytes>
        <TotalFlushBytes>0</TotalFlushBytes>
        <FlushCount>0</FlushCount>
        <ComminicationCount>150</ComminicationCount>
        <MinCommunicationSize>164</MinCommunicationSize>
        <MaxCommunicationSize>502</MaxCommunicationSize>
        <AverageCommunicationSize>346.1333333333333</AverageCommunicationSize>
        <MillisOpen>105452</MillisOpen>
    </ConnectionStatistics>
 

All Instances Report Example XML

    <AllConnectionStatistics>
        <ConnectionStatistics sessionId="xxxxxx">
            <TotalBytesSent>51920</TotalBytesSent>
            <TotalCommunicationBytes>51920</TotalCommunicationBytes>
            <TotalFlushBytes>0</TotalFlushBytes>
            <FlushCount>0</FlushCount>
            <ComminicationCount>150</ComminicationCount>
            <MinCommunicationSize>164</MinCommunicationSize>
            <MaxCommunicationSize>502</MaxCommunicationSize>
            <AverageCommunicationSize>346.1333333333333</AverageCommunicationSize>
            <MillisOpen>105452</MillisOpen>
        </ConnectionStatistics>
        <ConnectionStatistics sessionId="yyyyyy">
            <TotalBytesSent>51920</TotalBytesSent>
            <TotalCommunicationBytes>51920</TotalCommunicationBytes>
            <TotalFlushBytes>0</TotalFlushBytes>
            <FlushCount>0</FlushCount>
            <ComminicationCount>150</ComminicationCount>
            <MinCommunicationSize>164</MinCommunicationSize>
            <MaxCommunicationSize>502</MaxCommunicationSize>
            <AverageCommunicationSize>346.1333333333333</AverageCommunicationSize>
            <MillisOpen>105452</MillisOpen>
        </ConnectionStatistics>
    </AllConnectionStatistics>
 

See Also:
PushConnection

Constructor Summary
ConnectionStatistics(java.lang.String sessionId)
          This constructor is used internally by Nexaweb.
 
Method Summary
static java.util.List getAllInstances()
          Returns all instances of ConnectionStatistics.
 double getAverageCommunicationSize()
          Returns the average size of all application communications to have been sent over the associated PushConnection.
 long getCommunicationCount()
          Returns the number of application communications that have been sent over the associated PushConnection.
 long getFlushCount()
          Returns the number of flushes that have been sent over the associated PushConnection.
 long getMaxCommunicationSize()
          Returns the size of the largest application communication to have been sent over the associated PushConnection.
 long getMillisOpen()
          Returns the number of milliseconds that this connection has been open.
 long getMinCommunicationSize()
          Returns the size of the smallest application communication to have been sent over the associated PushConnection.
 java.lang.String getReportAsXml()
          Returns an XML formatted report of all statistics.
 java.lang.String getReportAsXml(int level)
          Returns an XML formatted report of all statistics.
static java.lang.String getReportForAllInstancesAsXml()
          Returns an XML report for all instances of ConnectionStatistics.
static java.lang.String getReportForAllInstancesAsXml(int level)
          Returns an XML report for all instances of ConnectionStatistics.
 long getTotalBytesSent()
          Returns the total number of bytes that have been sent over the associated PushConnection.
 long getTotalCommunicationBytesSent()
          Returns the total number of bytes that have been sent over the associated PushConnection as a result of application data.
 long getTotalFlushBytesSent()
          Returns the total number of bytes that have been sent over the associated PushConnection as a result of flushing by a FlushPolicy.
 void onDataFlow(int length, boolean isFlush)
          This method gathers statistics on the data as it flows over the push connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionStatistics

public ConnectionStatistics(java.lang.String sessionId)
This constructor is used internally by Nexaweb. Customers should not construct this object directly.

Parameters:
sessionId - The session id of the session that owns the parent PushConnection.
Method Detail

getAllInstances

public static java.util.List getAllInstances()
Returns all instances of ConnectionStatistics.

Returns:
A list containing all instances of ConnectionStatistics.

getReportForAllInstancesAsXml

public static java.lang.String getReportForAllInstancesAsXml()
Returns an XML report for all instances of ConnectionStatistics.

Returns:
The report XML format.

getReportForAllInstancesAsXml

public static java.lang.String getReportForAllInstancesAsXml(int level)
Returns an XML report for all instances of ConnectionStatistics.

Returns:
The report XML format.

onDataFlow

public void onDataFlow(int length,
                       boolean isFlush)
This method gathers statistics on the data as it flows over the push connection.

Parameters:
length - The length of the data.
isFlush - A boolean value indicating whether the data flowing is flush data.

getReportAsXml

public java.lang.String getReportAsXml()
Returns an XML formatted report of all statistics.

Returns:
The report of all statistics as an XML String.

getReportAsXml

public java.lang.String getReportAsXml(int level)
Returns an XML formatted report of all statistics.

Returns:
The report of all statistics as an XML String.

getTotalBytesSent

public long getTotalBytesSent()
Returns the total number of bytes that have been sent over the associated PushConnection. The returned value is the equivalent of the expression getTotalCommunicationBytesSent() + getTotalFlushBytesSent()

Returns:
The total number of bytes that have been sent over the associated PushConnection.

getTotalCommunicationBytesSent

public long getTotalCommunicationBytesSent()
Returns the total number of bytes that have been sent over the associated PushConnection as a result of application data. The returned value is the equivalent of the expression getTotalBytesSent() - getTotalFlushBytesSent().

Returns:
The total number of bytes that have been sent over the associated PushConnection as a result of application communications.

getTotalFlushBytesSent

public long getTotalFlushBytesSent()
Returns the total number of bytes that have been sent over the associated PushConnection as a result of flushing by a FlushPolicy. The returned value is the equivalent of the expression getTotalBytesSent() - getTotalCommunicationBytesSent().

Returns:
The total number of bytes that have been sent over the associated PushConnection as a result of flushing.

getFlushCount

public long getFlushCount()
Returns the number of flushes that have been sent over the associated PushConnection.

Returns:
The number of flushes that have been sent.

getCommunicationCount

public long getCommunicationCount()
Returns the number of application communications that have been sent over the associated PushConnection.

Returns:
The number of application communications that have been sent.

getMinCommunicationSize

public long getMinCommunicationSize()
Returns the size of the smallest application communication to have been sent over the associated PushConnection.

Returns:
The size of the smallest application communication.

getMaxCommunicationSize

public long getMaxCommunicationSize()
Returns the size of the largest application communication to have been sent over the associated PushConnection.

Returns:
The size of the largest application communication.

getAverageCommunicationSize

public double getAverageCommunicationSize()
Returns the average size of all application communications to have been sent over the associated PushConnection.

Returns:
The average size of all application communications.

getMillisOpen

public long getMillisOpen()
Returns the number of milliseconds that this connection has been open.

Returns:
The number of milliseconds the associated connection has been open.


Copyright © 2005 Nexaweb Technologies, Inc. All Rights Reserved.