Class MetricProfile

java.lang.Object
org.tasktide.core.model.job_env.metrics.MetricProfile
All Implemented Interfaces:
TaskTideModel<MetricProfile>

@Entity public class MetricProfile extends Object implements TaskTideModel<MetricProfile>
Holds ProfileData and computes mean across its observed MetricData datapoints as its own Entity.
  • Constructor Details

    • MetricProfile

      public MetricProfile()
      Empty constructor
    • MetricProfile

      public MetricProfile(String id, String label, long timestamp, String units, float meanTotal, float meanAvailable, float meanUsed, ProfileData profile, MetricType type, String jobEnvId, CustomAnnotation anno)
      Construct with data
      Parameters:
      id -
      label -
      timestamp -
      units -
      meanTotal -
      meanAvailable -
      meanUsed -
      profile -
      type -
      jobEnvId -
      anno -
  • Method Details

    • getAnnotations

      public CustomAnnotation getAnnotations()
      Get annotations
      Specified by:
      getAnnotations in interface TaskTideModel<MetricProfile>
      Returns:
      CustomAnnotation
    • setAnnotations

      public void setAnnotations(CustomAnnotation anno)
      Set annotation provided
      Specified by:
      setAnnotations in interface TaskTideModel<MetricProfile>
      Parameters:
      anno -
    • toJson

      public String toJson()
      Represent as JSON-B string
      Specified by:
      toJson in interface TaskTideModel<MetricProfile>
      Returns:
      String
    • toJsonDoc

      public String toJsonDoc()
      Represent as JSON-B Document
      Specified by:
      toJsonDoc in interface TaskTideModel<MetricProfile>
      Returns:
      String
    • getId

      public String getId()
      Get profile Id
      Specified by:
      getId in interface TaskTideModel<MetricProfile>
      Returns:
      String
    • getState

      public String getState()
      Get units as state
      Specified by:
      getState in interface TaskTideModel<MetricProfile>
      Returns:
    • getCollection

      public String getCollection()
      Return MetricType
      Specified by:
      getCollection in interface TaskTideModel<MetricProfile>
      Returns:
      String
    • resetModel

      public void resetModel()
      Reset model to empty
      Specified by:
      resetModel in interface TaskTideModel<MetricProfile>
    • getJobEnvId

      public String getJobEnvId()
      Returns:
      String
    • setJobEnvId

      public void setJobEnvId(String jobEnvId)
      Parameters:
      jobEnvId -
    • getLabel

      public String getLabel()
      Get profile label
      Returns:
      String
    • setLabel

      public void setLabel(String label)
      Set profile label
      Parameters:
      label -
    • getTimestamp

      public long getTimestamp()
      Get profile timestamp
      Returns:
      long
    • setTimestamp

      public void setTimestamp(long timestamp)
      Set time stamp
      Parameters:
      timestamp -
    • getMeanTotal

      public float getMeanTotal()
      Get mean total
      Returns:
      float
    • setMeanTotal

      public void setMeanTotal(float meanTotal)
      Set mean total
      Parameters:
      meanTotal -
    • getMeanAvailable

      public float getMeanAvailable()
      Get mean available
      Returns:
      float
    • setMeanAvailable

      public void setMeanAvailable(float meanAvailable)
      Set mean available
      Parameters:
      meanAvailable -
    • getMeanUsed

      public float getMeanUsed()
      Get mean used
      Returns:
      float
    • setMeanUsed

      public void setMeanUsed(float meanUsed)
      Set mean used
      Parameters:
      meanUsed -
    • getProfile

      public ProfileData getProfile()
      Get profiled data
      Returns:
      ProfileData
    • setProfile

      public void setProfile(ProfileData profile)
      Set profile data
      Parameters:
      profile -
    • getMetricType

      public MetricType getMetricType()
      Returns:
      MetricType
    • setMetricType

      public void setMetricType(MetricType metricType)
      Parameters:
      metricType -
    • getUnits

      public String getUnits()
      Get units for profile
      Returns:
      String
    • setUnits

      public void setUnits(String units)
      Set units
      Parameters:
      units -
    • toString

      public String toString()
      Represent as string
      Overrides:
      toString in class Object
      Returns:
      String
    • getValueFromField

      public Object getValueFromField(String field)
      Get value of queried field
      Specified by:
      getValueFromField in interface TaskTideModel<MetricProfile>
      Parameters:
      field -
      Returns:
      Object