Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
Added optional end argument to get_metrics method
Browse files Browse the repository at this point in the history
  • Loading branch information
jpaidoussi committed Feb 17, 2017
1 parent 782ccbc commit 0410772
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion go_http/metrics.py
Expand Up @@ -54,7 +54,7 @@ def _api_request(self, method, api_collection, data=None):
r.raise_for_status()
return r.json()

def get_metric(self, metric, start, interval, nulls):
def get_metric(self, metric, start, interval, nulls, end=None):
"""
Get a metric.
Expand All @@ -66,13 +66,17 @@ def get_metric(self, metric, start, interval, nulls):
Bucket size for grouping (e.g. `1d`).
:param str nulls:
How nulls should be handled (e.g. `omit`).
:param str end:
When to get metrics until (e.g. `-30d`).
"""
payload = {
"m": metric,
"from": start,
"interval": interval,
"nulls": nulls
}
if end is not None:
payload['until'] = end
return self._api_request("GET", "metrics/", payload)

def fire(self, metrics):
Expand Down

0 comments on commit 0410772

Please sign in to comment.