edu.isi.pegasus.planner.visualize.nodeusage
Class Ploticus

java.lang.Object
  extended by edu.isi.pegasus.planner.visualize.nodeusage.Ploticus

public class Ploticus
extends Object

An implementation that plots in the Ploticus format.

Version:
$Revision: 2563 $
Author:
Karan Vahi

Field Summary
static String DEFAULT_TIMING_UNITS
          The default timing units.
static String HOURS_TIMING_UNITS
          The minutes unit for the x axis.
private  String mBasename
          The basename of the files.
private  String mDirectory
          The directory where the files are to be generated.
static String MINUTES_TIMING_UNITS
          The minutes unit for the x axis.
private  LogManager mLogger
          The handle to the logging object.
private  NumberFormat mNumFormatter
          The number formatter to format the float entries.
private  String mTimeUnits
          The time units.
private  boolean mUseStatInfo
          A boolean indicating whether to use stat info or not.
 
Constructor Summary
Ploticus()
          The default constructor.
 
Method Summary
protected  String constructEntry(String job, float time, long measurement)
          Returns an entry that needs to be plotted in the graph.
private  float convertFromSecondsTo(long time, String units)
          Converts from seconds to one of the units specified.
 void generateScriptFile(String name, String dataFile, String yUnits, float maxX, float maxY)
          Generates the script file required to give as input to ploticus.
protected  String getFilename(String site, String suffix)
          Returns the filename of the ploticus file to be generated.
 void initialize(String directory, String basename, boolean useStatInfo)
          Initializer method.
 List plot(WorkflowMeasurements wm, char unit, String timeUnits)
          Plot out the space usage.
private  boolean validTimeUnits(String units)
          Returns a boolean indicating if a valid time unit or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TIMING_UNITS

public static final String DEFAULT_TIMING_UNITS
The default timing units.

See Also:
Constant Field Values

MINUTES_TIMING_UNITS

public static final String MINUTES_TIMING_UNITS
The minutes unit for the x axis.

See Also:
Constant Field Values

HOURS_TIMING_UNITS

public static final String HOURS_TIMING_UNITS
The minutes unit for the x axis.

See Also:
Constant Field Values

mDirectory

private String mDirectory
The directory where the files are to be generated.


mBasename

private String mBasename
The basename of the files.


mUseStatInfo

private boolean mUseStatInfo
A boolean indicating whether to use stat info or not.


mLogger

private LogManager mLogger
The handle to the logging object.


mNumFormatter

private NumberFormat mNumFormatter
The number formatter to format the float entries.


mTimeUnits

private String mTimeUnits
The time units.

Constructor Detail

Ploticus

public Ploticus()
The default constructor.

Method Detail

initialize

public void initialize(String directory,
                       String basename,
                       boolean useStatInfo)
Initializer method.

Parameters:
directory - the directory where the plots need to be generated.
basename - the basename for the files that are generated.
useStatInfo - boolean indicating whether to use stat info or not.

plot

public List plot(WorkflowMeasurements wm,
                 char unit,
                 String timeUnits)
          throws IOException
Plot out the space usage. Writes out a Ploticus data file.

Parameters:
wm - the workflow measurements.
unit - the unit in which we need to plot the number.
timeUnits - units in which to plot time.
Returns:
List of file pathnames for the files that are written out.
Throws:
IOException - in case of unable to write to the file.

generateScriptFile

public void generateScriptFile(String name,
                               String dataFile,
                               String yUnits,
                               float maxX,
                               float maxY)
                        throws IOException
Generates the script file required to give as input to ploticus.

Parameters:
name - the path to the script file.
dataFile - the path to corresponding data file.
yUnits - the units for the space value.
maxX - the time in seconds.
maxY - the maximum space.
Throws:
IOException

getFilename

protected String getFilename(String site,
                             String suffix)
Returns the filename of the ploticus file to be generated.

Parameters:
site - the site handle.
suffix - the suffix to be applied to the file.
Returns:
the path to the file.

constructEntry

protected String constructEntry(String job,
                                float time,
                                long measurement)
Returns an entry that needs to be plotted in the graph.

Parameters:
job - the name of the associated job.
time - the time
measurement - measurement
Returns:
the entry to be logged

convertFromSecondsTo

private float convertFromSecondsTo(long time,
                                   String units)
Converts from seconds to one of the units specified.

Parameters:
time - the time.
units - the units
Returns:
converted value in long.

validTimeUnits

private boolean validTimeUnits(String units)
Returns a boolean indicating if a valid time unit or not.

Parameters:
units - the time unit.
Returns:
boolean


Copyright © 2011 The University of Southern California. All Rights Reserved.