(metric_key, metric_type, config, start_time, end_time)
return metric
Returns a list of tuples (timestamp, value) based on the historical data in database, in which value is
        calculated by a*x + b.
Returns a list of tuples (timestamp, value) based on the historical data in database, in which value is
        calculated by a*x + b.
Returns a list of tuples ( timestamp value ) based on the historical data in database in which value is calculated by a * x + b .
def get_historical_data(metric_key, metric_type, config, start_time, end_time):
    """ Returns a list of tuples (timestamp, value) based on the historical data in database, in which value is
        calculated by a*x + b.
    """
    aws_region = config["values"]["aws_region"]
    boto_client = ClustermanMetricsBotoClient(aws_region)
    result_key, result_items = boto_client.get_metric_values(
        metric_key, metric_type, start_time.timestamp, end_time.timestamp,
    )
    metric = []
    a = config["values"]["params"]["a"]
    b = config["values"]["params"]["b"]
    for item in result_items:
        metric.append((arrow.get(item[0]), a * float(item[1]) + b))
    return metric
def get_historical_data ( metric_key , metric_type , config , start_time , end_time ) : aws_region = config [ "values" ] [ "aws_region" ] boto_client = ClustermanMetricsBotoClient ( aws_region ) result_key , result_items = boto_client . get_metric_values ( metric_key , metric_type , start_time . timestamp , end_time . timestamp , ) metric = [ ] a = config [ "values" ] [ "params" ] [ "a" ] b = config [ "values" ] [ "params" ] [ "b" ] for item in result_items : metric . append ( ( arrow . get ( item [ 0 ] ) , a * float ( item [ 1 ] ) + b ) ) return metric