Class MetricData
java.lang.Object
org.tasktide.core.model.job_env.metrics.MetricData
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionNull constructorMetricData(String id, String label, long timestamp, double total, double available, double used, String units, MetricType metricType, CustomAnnotation anno) Construct with all arguments -
Method Summary
Modifier and TypeMethodDescriptionGet annotationsdoubleGet available resourcesReturnsMetricTypeas StringgetId()Get IdgetLabel()Get labelGet metrics typegetState()Returns units of the metric datalongGet timestampdoublegetTotal()Get total resourcesgetUnits()Get units of data pointdoublegetUsed()Get used resourcesgetValueFromField(String field) Get value of queried fieldvoidNulls modelvoidSet annotation providedvoidsetAvailable(double available) Sets available resourcesvoidSet IdvoidSet labelvoidsetMetricType(MetricType metricType) Sets metric typevoidsetTimestamp(long timestamp) Sets timestampvoidsetTotal(double total) Sets totalvoidSet unit of data pointvoidsetUsed(double used) Sets used resourcestoJson()Represent as JSON-B stringRepresent as JSON-B DocumenttoString()Represent as String
-
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
Get annotations- Specified by:
getAnnotationsin interfaceTaskTideModel<MetricData>- Returns:
CustomAnnotation
-
setAnnotations
Set annotation provided- Specified by:
setAnnotationsin interfaceTaskTideModel<MetricData>- Parameters:
anno-
-
getId
Get Id- Specified by:
getIdin interfaceTaskTideModel<MetricData>- Returns:
- String
-
setId
-
getLabel
-
setLabel
-
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
-
setUnits
-
getMetricType
-
setMetricType
-
toJson
Represent as JSON-B string- Specified by:
toJsonin interfaceTaskTideModel<MetricData>- Returns:
- String
-
toJsonDoc
Represent as JSON-B Document- Specified by:
toJsonDocin interfaceTaskTideModel<MetricData>- Returns:
-
getState
Returns units of the metric data- Specified by:
getStatein interfaceTaskTideModel<MetricData>- Returns:
- String
-
getCollection
ReturnsMetricTypeas String- Specified by:
getCollectionin interfaceTaskTideModel<MetricData>- Returns:
- String
-
resetModel
public void resetModel()Nulls model- Specified by:
resetModelin interfaceTaskTideModel<MetricData>
-
toString
-
getValueFromField
Get value of queried field- Specified by:
getValueFromFieldin interfaceTaskTideModel<MetricData>- Parameters:
field-- Returns:
- Object
-