SSF.Util.Plot
Class Analyzer

java.lang.Object
  |
  +--SSF.OS.NetFlow.Filter.FilterPlayer
        |
        +--SSF.Util.Plot.Analyzer
All Implemented Interfaces:
StreamInterface

public class Analyzer
extends FilterPlayer

Analyzes the raw binary data streams from the simulation to and bins it into time-bins. Queue monitor data is already binned but may be aggregated into larger bins. The raw flow data, on the other hand, is binned by computing the fraction of the (continuous) flow covering each bin. The result is that the time-bin holds the number of active flows at each time point.

Extends the FilterPlayer class to override some if its methods, primarily receive() and configFilters(). Changes the receive() behavior, but also uncludes multiple filters instead of the single filter in FilterPlayer. This permits multiple datasets to be generated from a single pass through the data file. $Id: Analyzer.java,v 1.12 2003/02/13 19:31:32 mili Exp $


Field Summary
static char QREC_LEN
           
static char QREC_PKTCOUNT
           
static char QREC_PKTDIFF
           
static char QREC_PKTDROPCNT
           
static char QREC_PKTDROPDIFF
           
static char UNSPEC
           
 
Fields inherited from class SSF.OS.NetFlow.Filter.FilterPlayer
filter, sourceDictionary, streamID, typeDictionary
 
Constructor Summary
Analyzer(int numDatasets, java.lang.String fileName, java.lang.String streamID)
          Constructs an analyzer object for streamID that quantizes the timepoints in the data into bins of size binSize.
 
Method Summary
protected  void addType(java.lang.String spec)
          addType copied from FilterPlayer and modified to handle multiple filters.
 void assignFieldSelectors(char[] fieldSelectors)
          Assign a field selector per filter.
 void assignFilters(Filter[] pFilters)
          Assign multiple filters to this "Player"/Analyzer.
 void binToArray(java.lang.Object[][] dataArray, float binSize)
          Bin data from stream into given array using given bin size.
 void configFilters(java.lang.String[] configFileNames)
          Configuration of filter given the name of a DML file that contains the filter configuration information.
 int receive(int tid, int sid, double time, byte[] buf, int offset, int length)
          Callback method for action to do for each read record.
 void wrapUp()
          Wrap-up.
 
Methods inherited from class SSF.OS.NetFlow.Filter.FilterPlayer
addSource, assignFilter, connectRead, connectWrite, disconnect, getRecordSourceCode, getRecordSourceString, getRecordTypeCode, getRecordTypeString, isConnected, main, send, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNSPEC

public static final char UNSPEC
See Also:
Constant Field Values

QREC_LEN

public static final char QREC_LEN
See Also:
Constant Field Values

QREC_PKTCOUNT

public static final char QREC_PKTCOUNT
See Also:
Constant Field Values

QREC_PKTDROPCNT

public static final char QREC_PKTDROPCNT
See Also:
Constant Field Values

QREC_PKTDIFF

public static final char QREC_PKTDIFF
See Also:
Constant Field Values

QREC_PKTDROPDIFF

public static final char QREC_PKTDROPDIFF
See Also:
Constant Field Values
Constructor Detail

Analyzer

public Analyzer(int numDatasets,
                java.lang.String fileName,
                java.lang.String streamID)
Constructs an analyzer object for streamID that quantizes the timepoints in the data into bins of size binSize.

Method Detail

binToArray

public void binToArray(java.lang.Object[][] dataArray,
                       float binSize)
                throws streamException
Bin data from stream into given array using given bin size.

streamException

assignFilters

public void assignFilters(Filter[] pFilters)
Assign multiple filters to this "Player"/Analyzer.


assignFieldSelectors

public void assignFieldSelectors(char[] fieldSelectors)
Assign a field selector per filter.


configFilters

public void configFilters(java.lang.String[] configFileNames)
Configuration of filter given the name of a DML file that contains the filter configuration information.


receive

public int receive(int tid,
                   int sid,
                   double time,
                   byte[] buf,
                   int offset,
                   int length)
Callback method for action to do for each read record. Check each read record against each specified dataset. If a filter has been selected for the dataset first check if the record passes the filter. The intercept queue probe interval records. These should just be collected for each dataset, but "do not count" as data records. Thus, two different types of data records for the same dataset is an error, but a probe interval record is not an error in conjunction with queue data records. On the contrary, it is required for averaging of queue length data.

Specified by:
receive in interface StreamInterface
Overrides:
receive in class FilterPlayer

addType

protected void addType(java.lang.String spec)
                throws streamException
addType copied from FilterPlayer and modified to handle multiple filters.

Overrides:
addType in class FilterPlayer
Parameters:
spec - the string generated from the record.
streamException

wrapUp

public void wrapUp()
Wrap-up. Just terminate progress printout.