Class MetricData

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

@Entity public class MetricData extends Object implements TaskTideModel<MetricData>
Holds metrics data for MetricType instances. These datapoints are annotated with a Label to denote any related collections (ex storage), and a Timestamp when metric was calculated.
  • Constructor Details

    • MetricData

      public MetricData()
      Null constructor
    • MetricData

      public MetricData(String id, String label, long timestamp, double total, double available, double used, String units, MetricType metricType, CustomAnnotation anno)
      Construct with all arguments
      Parameters:
      id -
      label -
      timestamp -
      total -
      available -
      used -
      units -
      metricType -
      anno -
  • Method Details

    • getAnnotations

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

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

      public String getId()
      Get Id
      Specified by:
      getId in interface TaskTideModel<MetricData>
      Returns:
      String
    • setId

      public void setId(String id)
      Set Id
      Parameters:
      id -
    • getLabel

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

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

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

      public void setTimestamp(long timestamp)
      Sets timestamp
      Parameters:
      timestamp -
    • getTotal

      public double getTotal()
      Get total resources
      Returns:
      double
    • setTotal

      public void setTotal(double total)
      Sets total
      Parameters:
      total -
    • getAvailable

      public double getAvailable()
      Get available resources
      Returns:
    • setAvailable

      public void setAvailable(double available)
      Sets available resources
      Parameters:
      available -
    • getUsed

      public double getUsed()
      Get used resources
      Returns:
      double
    • setUsed

      public void setUsed(double used)
      Sets used resources
      Parameters:
      used -
    • getUnits

      public String getUnits()
      Get units of data point
      Returns:
      String
    • setUnits

      public void setUnits(String units)
      Set unit of data point
      Parameters:
      units -
    • getMetricType

      public MetricType getMetricType()
      Get metrics type
      Returns:
      MetricType
    • setMetricType

      public void setMetricType(MetricType metricType)
      Sets metric type
      Parameters:
      metricType -
    • toJson

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

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

      public String getState()
      Returns units of the metric data
      Specified by:
      getState in interface TaskTideModel<MetricData>
      Returns:
      String
    • getCollection

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

      public void resetModel()
      Nulls model
      Specified by:
      resetModel in interface TaskTideModel<MetricData>
    • 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<MetricData>
      Parameters:
      field -
      Returns:
      Object