org.ow2.jasmine.monitoring.mbeancmd.audit
Class FileCollector

java.lang.Object
  extended by org.ow2.jasmine.monitoring.mbeancmd.audit.FileCollector

public class FileCollector
extends java.lang.Object

Author:
waeselyf

Constructor Summary
FileCollector(java.io.File file)
          Constructor from a file
FileCollector(java.io.InputStream in)
          Constructor from an input stream (e.g.
 
Method Summary
 void enableStatistics()
          Enable statistics.
 java.util.HashMap<java.lang.String,Metric> getBaseline()
           
 java.util.LinkedList<Metric> getPoll()
           
 java.lang.String getSeparator()
           
 java.util.LinkedList<Metric> getStats(java.lang.String attr)
          Builds a LinkedList of metrics from the computed statistics Each metrics as a list of attributes derived from attr through the scan - average: mean value for the full scan - averageNonZero: mean value, considering only non null values - minNotzero: the minimal not null value - max: maximum value
 void scan()
          Scans the file or input stream
 void setAttributes(java.lang.String[] attributes)
          Set the attributes to scan
 void setSeparator(java.lang.String separator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCollector

public FileCollector(java.io.InputStream in)
Constructor from an input stream (e.g. System.in)

Parameters:
in -

FileCollector

public FileCollector(java.io.File file)
              throws java.io.FileNotFoundException
Constructor from a file

Parameters:
file -
Throws:
java.io.FileNotFoundException
Method Detail

scan

public void scan()
Scans the file or input stream. - builds the baseline from initial values. - builds the most recent metrics - if on, computes statistics on a per attribute basis.


getPoll

public java.util.LinkedList<Metric> getPoll()
Returns:

getBaseline

public java.util.HashMap<java.lang.String,Metric> getBaseline()

getStats

public java.util.LinkedList<Metric> getStats(java.lang.String attr)
Builds a LinkedList of metrics from the computed statistics Each metrics as a list of attributes derived from attr through the scan - average: mean value for the full scan - averageNonZero: mean value, considering only non null values - minNotzero: the minimal not null value - max: maximum value. - timeInterval: the time interval of the full scan - timeNonZero: cumulated time whete attr has a non null value. - ratioNonZero: timeNonZero/timeInterval

Parameters:
attr -
Returns:

setAttributes

public void setAttributes(java.lang.String[] attributes)
Set the attributes to scan

Parameters:
attributes -

getSeparator

public java.lang.String getSeparator()
Returns:
the separator

setSeparator

public void setSeparator(java.lang.String separator)
Parameters:
separator - the separator to set

enableStatistics

public void enableStatistics()
Enable statistics. Statistics will be computed only y this method is called.



Copyright © 2009 OW2 Consortium. All Rights Reserved.