'Get historical usage metrics.
webspace_name:
The name of the webspace.
website_name:
The name of the website.
metrics:
Optional. List of metrics name. Otherwise, all metrics returned.
start_time:
Optional. An ISO8601 date. Otherwise, current hour is used.
end_time:
Optional. An ISO8601 date. Otherwise, current time is used.
time_grain:
Optional. A rollup name, as P1D. OTherwise, default rollup for the metrics is used.
More information and metrics name at:
http://msdn.microsoft.com/en-us/library/azure/dn166964.aspx'

def get_historical_usage_metrics(self, webspace_name, website_name, metrics=None, start_time=None, end_time=None, time_grain=None):

    metrics = (('names=' + ','.join(metrics)) if metrics else '')
    start_time = (('StartTime=' + start_time) if start_time else '')
    end_time = (('EndTime=' + end_time) if end_time else '')
    time_grain = (('TimeGrain=' + time_grain) if time_grain else '')
    parameters = '&'.join((v for v in (metrics, start_time, end_time, time_grain) if v))
    parameters = (('?' + parameters) if parameters else '')
    return self._perform_get((self._get_historical_usage_metrics_path(webspace_name, website_name) + parameters), MetricResponses)
