edu.isi.pegasus.planner.classes

## Class WorkflowMetrics

- java.lang.Object
- - edu.isi.pegasus.planner.classes.Data
  - - edu.isi.pegasus.planner.classes.WorkflowMetrics

All Implemented Interfaces:
  java.lang.Cloneable

    public class WorkflowMetrics
    extends Data
    implements java.lang.Cloneable

A Workflow metrics class that stores the metrics about the workflow.

Version:
  $Revision$
Author:
  Karan Vahi

### Field Summary

Fields
`private java.lang.String` `mDAXLabel` The label of the dax.
`private boolean` `mLockTaskMetrics` A boolean indicating whether to update task metrics
`private int` `mNumChmodJobs`
`private int` `mNumCleanupJobs` The number of cleanup jobs.
`private int` `mNumClusteredJobs` The number of clustered compute jobs.
`private int` `mNumComputeJobs` The number of compute jobs.
`private int` `mNumComputeTasks` The number of compute tasks in the DAX
`private int` `mNumCreateDirJobs` The number of create dir jobs.
`private int` `mNumDAGJobs` The number of DAG jobs in the workflow
`private int` `mNumDAGTasks` The number of DAG tasks in the DAX.
`private int` `mNumDAXJobs` The number of dax jobs in the workflow
`private int` `mNumDAXTasks` The number of DAX tasks in the DAX
`private int` `mNumInterTxJobs` The number of inter-site transfer jobs.
`private int` `mNumRegJobs` The number of registration jobs.
`private int` `mNumSITxJobs` The number of stage in transfer jobs.
`private int` `mNumSOTxJobs` The number of stage-out transfer jobs.
`private int` `mNumTotalJobs` The total number of jobs in the executable workflow.
`private int` `mNumTotalTasks` The total number of tasks in the executable workflow.

### Fields inherited from class edu.isi.pegasus.planner.classes.Data

`mLogger, mLogMsg`

### Constructor Summary

Constructors
Constructor and Description
`WorkflowMetrics()` The default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `append(java.lang.StringBuffer buffer, java.lang.String key, int value)` Appends a key=value pair to the StringBuffer.
`protected void` `append(java.lang.StringBuffer buffer, java.lang.String key, java.lang.String value)` Appends a key=value pair to the StringBuffer.
`java.lang.Object` `clone()` Returns the clone of the object.
`void` `decrement(Job job)` Decrement the metrics when on the basis of type of job being removed
`private void` `decrementJobMetrics(Job job)` Decrement the metrics when on the basis of type of job.
`private void` `decrementTaskMetrics(Job job)` Decrement the task metrics when on the basis of type of job.
`java.lang.String` `getLabel()` Returns the DAXlabel.
`void` `increment(Job job)` Increment the metrics when on the basis of type of job.
`private void` `incrementJobMetrics(Job job)` Increment the metrics when on the basis of type of job.
`private void` `incrementTaskMetrics(Job job)` Increment the metrics when on the basis of type of job.
`void` `lockTaskMetrics(boolean lock)` Sets the lock task metrics parameters.
`void` `reset(boolean resetTaskMetrics)` Resets the internal counters to zero.
`void` `setLabel(java.lang.String label)` Sets the DAXlabel.
`java.lang.String` `toJson()` Converts the planner metrics to JSON
`java.lang.String` `toPrettyJson()` Converts the planner metrics to JSON
`java.lang.String` `toString()` Returns a textual description of the object.

### Methods inherited from class edu.isi.pegasus.planner.classes.Data

`setToString, vectorToString`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### mNumComputeTasks

    private int mNumComputeTasks

The number of compute tasks in the DAX

#### mNumDAXTasks

    private int mNumDAXTasks

The number of DAX tasks in the DAX

#### mNumDAGTasks

    private int mNumDAGTasks

The number of DAG tasks in the DAX.

#### mNumTotalTasks

    private int mNumTotalTasks

The total number of tasks in the executable workflow.

#### mNumComputeJobs

    private int mNumComputeJobs

The number of compute jobs.

#### mNumClusteredJobs

    private int mNumClusteredJobs

The number of clustered compute jobs.

#### mNumSITxJobs

    private int mNumSITxJobs

The number of stage in transfer jobs.

#### mNumSOTxJobs

    private int mNumSOTxJobs

The number of stage-out transfer jobs.

#### mNumInterTxJobs

    private int mNumInterTxJobs

The number of inter-site transfer jobs.

#### mNumRegJobs

    private int mNumRegJobs

The number of registration jobs.

#### mNumCleanupJobs

    private int mNumCleanupJobs

The number of cleanup jobs.

#### mNumCreateDirJobs

    private int mNumCreateDirJobs

The number of create dir jobs.

#### mNumDAXJobs

    private int mNumDAXJobs

The number of dax jobs in the workflow

#### mNumDAGJobs

    private int mNumDAGJobs

The number of DAG jobs in the workflow

#### mNumChmodJobs

    private int mNumChmodJobs

#### mNumTotalJobs

    private int mNumTotalJobs

The total number of jobs in the executable workflow.

#### mDAXLabel

    private java.lang.String mDAXLabel

The label of the dax.

#### mLockTaskMetrics

    private transient boolean mLockTaskMetrics

A boolean indicating whether to update task metrics

### Constructor Detail

#### WorkflowMetrics

    public WorkflowMetrics()

The default constructor.

### Method Detail

#### reset

    public final void reset(boolean resetTaskMetrics)

Resets the internal counters to zero.

Parameters:
  `resetTaskMetrics` - whether to reset task metrics or not

#### setLabel

    public void setLabel(java.lang.String label)

Sets the DAXlabel.

Parameters:
  `label` - the dax label

#### getLabel

    public java.lang.String getLabel()

Returns the DAXlabel.

Returns:
  the dax label

#### lockTaskMetrics

    public void lockTaskMetrics(boolean lock)

Sets the lock task metrics parameters. If the lock is set, the task metrics are no longer updated on subsequent calls to increment / decrement.

Parameters:
  `lock` - the boolean parameter

#### increment

    public void increment(Job job)

Increment the metrics when on the basis of type of job.

Parameters:
  `job` - the job being added.

#### incrementTaskMetrics

    private void incrementTaskMetrics(Job job)

Increment the metrics when on the basis of type of job.

Parameters:
  `job` - the job being added.

#### incrementJobMetrics

    private void incrementJobMetrics(Job job)

Increment the metrics when on the basis of type of job.

Parameters:
  `job` - the job being added.

#### decrement

    public void decrement(Job job)

Decrement the metrics when on the basis of type of job being removed

Parameters:
  `job` - the job being added.

#### decrementJobMetrics

    private void decrementJobMetrics(Job job)

Decrement the metrics when on the basis of type of job. Does not decrement the task related metrics.

Parameters:
  `job` - the job being removed.

#### decrementTaskMetrics

    private void decrementTaskMetrics(Job job)

Decrement the task metrics when on the basis of type of job.

Parameters:
  `job` - the job being removed.

#### toString

    public java.lang.String toString()

Returns a textual description of the object.

Specified by:
  `toString` in class `Data`
Returns:
  Object

#### append

    protected void append(java.lang.StringBuffer buffer,
                          java.lang.String key,
                          java.lang.String value)

Appends a key=value pair to the StringBuffer.

Parameters:
  `buffer` - the StringBuffer that is to be appended to.
  `key` - the key.
  `value` - the value.

#### append

    protected void append(java.lang.StringBuffer buffer,
                          java.lang.String key,
                          int value)

Appends a key=value pair to the StringBuffer.

Parameters:
  `buffer` - the StringBuffer that is to be appended to.
  `key` - the key.
  `value` - the value.

#### toJson

    public java.lang.String toJson()

Converts the planner metrics to JSON

Returns:
  the planner metrics in JSON

#### toPrettyJson

    public java.lang.String toPrettyJson()

Converts the planner metrics to JSON

Returns:
  the planner metrics in JSON

#### clone

    public java.lang.Object clone()

Returns the clone of the object.

Overrides:
  `clone` in class `java.lang.Object`
Returns:
  the clone