Class 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
    • Constructor Summary

      Constructors 
      Constructor Description
      WorkflowMetrics()
      The default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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 java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • mNumComputeTasks

        @SerializedName("compute_tasks")
        @Expose
        private int mNumComputeTasks
        The number of compute tasks in the DAX
      • mNumDAXTasks

        @SerializedName("dax_tasks")
        @Expose
        private int mNumDAXTasks
        The number of DAX tasks in the DAX
      • mNumDAGTasks

        @SerializedName("dag_tasks")
        @Expose
        private int mNumDAGTasks
        The number of DAG tasks in the DAX.
      • mNumTotalTasks

        @SerializedName("total_tasks")
        @Expose
        private int mNumTotalTasks
        The total number of tasks in the executable workflow.
      • mNumComputeJobs

        @SerializedName("compute_jobs")
        @Expose
        private int mNumComputeJobs
        The number of compute jobs.
      • mNumClusteredJobs

        @SerializedName("clustered_jobs")
        @Expose
        private int mNumClusteredJobs
        The number of clustered compute jobs.
      • mNumSITxJobs

        @SerializedName("si_tx_jobs")
        @Expose
        private int mNumSITxJobs
        The number of stage in transfer jobs.
      • mNumSOTxJobs

        @SerializedName("so_tx_jobs")
        @Expose
        private int mNumSOTxJobs
        The number of stage-out transfer jobs.
      • mNumInterTxJobs

        @SerializedName("inter_tx_jobs")
        @Expose
        private int mNumInterTxJobs
        The number of inter-site transfer jobs.
      • mNumRegJobs

        @SerializedName("reg_jobs")
        @Expose
        private int mNumRegJobs
        The number of registration jobs.
      • mNumCleanupJobs

        @SerializedName("cleanup_jobs")
        @Expose
        private int mNumCleanupJobs
        The number of cleanup jobs.
      • mNumCreateDirJobs

        @SerializedName("create_dir_jobs")
        @Expose
        private int mNumCreateDirJobs
        The number of create dir jobs.
      • mNumDAXJobs

        @SerializedName("dax_jobs")
        @Expose
        private int mNumDAXJobs
        The number of dax jobs in the workflow
      • mNumDAGJobs

        @SerializedName("dag_jobs")
        @Expose
        private int mNumDAGJobs
        The number of DAG jobs in the workflow
      • mNumChmodJobs

        @SerializedName("chmod_jobs")
        @Expose
        private int mNumChmodJobs
      • mNumTotalJobs

        @SerializedName("total_jobs")
        @Expose
        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