def get_delta(name):
 [curr_metrics, last_metrics] = get_metrics()
 metric_name_list = name.split('_')[1:]
 metric_name = '_'.join(metric_name_list)
 try:
  delta = ((float(curr_metrics['data'][metric_name]) - float(last_metrics['data'][metric_name])) / (curr_metrics['time'] - last_metrics['time']))
  if (delta < 0):
   if Debug:
    print (name + ' is less 0. Setting value to 0.')
   delta = 0
 except KeyError:
  if Debug:
   print (('Key ' + name) + " can't be found.")
  delta = 0.0
 return delta

def get_delta ( name ) : [ curr_metrics , last_metrics ] = get_metrics ( ) metric_name_list = name . split ( '_' ) [ 1 : ] metric_name = '_' . join ( metric_name_list ) try : delta = ( ( float ( curr_metrics [ 'data' ] [ metric_name ] ) - float ( last_metrics [ 'data' ] [ metric_name ] ) ) / ( curr_metrics [ 'time' ] - last_metrics [ 'time' ] ) ) if ( delta < 0 ) : if Debug : print ( name + ' is less 0. Setting value to 0.' ) delta = 0 except KeyError : if Debug : print ( ( 'Key ' + name ) + " can't be found." ) delta = 0.0 return delta
return change over time for the requested metric .