if len(metric_data) == 0:
raise Exception("Metric "%s" is malformed. No data found." % metric_name)
last_line = metric_data[-1]
timestamp, val = last_line.strip().split(" ")
return Metric(metric_name, float(val), int(timestamp))
def get_all_metrics(self, run_uuid):
_validate_run_id(run_uuid)
After Change
// based on their first differing element. Therefore, we use max() operator to find the
// largest value at the largest timestamp. For more information, see
// https://docs.python.org/3/reference/expressions.html//value-comparisons
max_timestamp, max_value = max(metric_data)
return Metric(metric_name, max_value, max_timestamp)
def get_all_metrics(self, run_uuid):
_validate_run_id(run_uuid)