diff --git a/pyawschart/__init__.py b/pyawschart/__init__.py index fca1409..40d16b5 100644 --- a/pyawschart/__init__.py +++ b/pyawschart/__init__.py @@ -83,11 +83,15 @@ def _get_datapoints(self): ) return self._datapoints + def _get_chart(self): if not self._chart: - datapoints = self._get_datapoints() - data = [datapoint['Average'] for datapoint in self._datapoints] + self._get_datapoints() + key = 'Sum' if self._datapoints and 'Sum' in self._datapoints[0] + else 'Average' + data = [datapoint[key] for datapoint in self._datapoints] + # Set the vertical range from 0 to 100 max_y = 1 if data: diff --git a/pyawschart/elb.py b/pyawschart/elb.py index 90a627f..345ad32 100644 --- a/pyawschart/elb.py +++ b/pyawschart/elb.py @@ -26,8 +26,8 @@ def __init__(self, cloudwatch_connection=None, instance=None, range=None): ELBChart.__init__(self, cloudwatch_connection, instance, range) self.metric_verbose = 'Request count' self.args['metric'] = 'RequestCount' - self.args['statistics'] = 'Average' - self.args['unit'] = 'Count/Second' + self.args['statistics'] = 'Sum' + self.args['unit'] = 'Count' CHART_CLASSES.append(RequestCountChart)