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

java.lang.Object
  extended by edu.isi.pegasus.planner.visualize.spaceusage.Ploticus
All Implemented Interfaces:
Plot

public class Ploticus
extends Object
implements Plot

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 EMPTY_DIRECTORY_SIZE
          The size of an empty directory as reported by du -s
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.
 
Fields inherited from interface edu.isi.pegasus.planner.visualize.spaceusage.Plot
VERSION
 
Constructor Summary
Ploticus()
          The default constructor.
 
Method Summary
protected  String constructEntry(String job, float time, float clnup_size, float no_clnup_size)
          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 maxTime, float maxSpace)
          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(SpaceUsage su, 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

EMPTY_DIRECTORY_SIZE

public static final String EMPTY_DIRECTORY_SIZE
The size of an empty directory as reported by du -s

See Also:
Constant Field Values

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.

Specified by:
initialize in interface Plot
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(SpaceUsage su,
                 char unit,
                 String timeUnits)
          throws IOException
Plot out the space usage. Writes out a Ploticus data file.

Specified by:
plot in interface Plot
Parameters:
su - the SpaceUsage.
unit - the unit in which we need to plot. (K,M,G)
timeUnits - the time unit.
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 maxTime,
                               float maxSpace)
                        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.
maxTime - the time in seconds.
maxSpace - 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,
                                float clnup_size,
                                float no_clnup_size)
Returns an entry that needs to be plotted in the graph.

Parameters:
job - the name of the associated job.
time - the time
clnup_size - the size with cleanup
no_clnup_size - the size without cleanup
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.