org.openflow.gui.stats
Class PortStatsRates

java.lang.Object
  extended by org.openflow.gui.stats.PortStats
      extended by org.openflow.gui.stats.PortStatsRates

public class PortStatsRates
extends PortStats

Augments PortStats by keeping track of the rates of packets, bits, and flows.

Author:
David Underhill

Field Summary
protected  double bitsPerSec
          rate of bits per second
protected  double flowsPerSec
          rate of flows per second
protected  double packetsPerSec
          rate of packets per second
protected  double weightOfNew
          weight of new rates relative to previous rates
 
Fields inherited from class org.openflow.gui.stats.PortStats
numBytes, numFlows, numPackets, updateTime
 
Constructor Summary
PortStatsRates(Match m)
           
PortStatsRates(Match m, double weightOfNew)
           
 
Method Summary
 double getBitsPerSec()
          Gets the number of bits per second for these stats
 double getFlowsPerSec()
          Gets the number of flows per second for these stats
 double getPacketsPerSec()
          Gets the number of packets per second for these stats
 double getWeightOfNew()
          Gets how strongly new rates are weighted over the previous weight
 void setRates(double packetsPerSec, double bitsPerSec, double flowsPerSec, long when)
          update the rates directly
 void setWeightOfNew(double w)
          Sets how strongly new rates are weighted over the previous weight.
 java.lang.String toString()
          includes the last update time and the current rates
 void update(long packetCount, long byteCount, int flowCount, long when)
          update the statistics with the specified values and recompute rates
 
Methods inherited from class org.openflow.gui.stats.PortStats
getByteCount, getFlowCount, getLastUpdateTime, getPacketCount, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

packetsPerSec

protected double packetsPerSec
rate of packets per second


bitsPerSec

protected double bitsPerSec
rate of bits per second


flowsPerSec

protected double flowsPerSec
rate of flows per second


weightOfNew

protected double weightOfNew
weight of new rates relative to previous rates

Constructor Detail

PortStatsRates

public PortStatsRates(Match m)

PortStatsRates

public PortStatsRates(Match m,
                      double weightOfNew)
Method Detail

getPacketsPerSec

public double getPacketsPerSec()
Gets the number of packets per second for these stats


getBitsPerSec

public double getBitsPerSec()
Gets the number of bits per second for these stats


getFlowsPerSec

public double getFlowsPerSec()
Gets the number of flows per second for these stats


getWeightOfNew

public double getWeightOfNew()
Gets how strongly new rates are weighted over the previous weight


setWeightOfNew

public void setWeightOfNew(double w)
Sets how strongly new rates are weighted over the previous weight.

Parameters:
w - will be clamped to the range of 0.0 to 1.0 inclusive

setRates

public void setRates(double packetsPerSec,
                     double bitsPerSec,
                     double flowsPerSec,
                     long when)
update the rates directly


update

public void update(long packetCount,
                   long byteCount,
                   int flowCount,
                   long when)
update the statistics with the specified values and recompute rates

Overrides:
update in class PortStats

toString

public java.lang.String toString()
includes the last update time and the current rates

Overrides:
toString in class PortStats