Skip to content

Commit c37f12c

Browse files
committed
Upgrade to use /raw endpoint when pushing and fetching statistics
1 parent b1d0ce5 commit c37f12c

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

hawkular/metrics.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class MetricType:
1717
Gauge = 'gauges'
1818
Availability = 'availability'
1919
Counter = 'counters'
20+
Rate = 'rate'
2021

2122
@staticmethod
2223
def short(metric_type):
@@ -92,9 +93,12 @@ def _get_url(self, metric_type):
9293

9394
def _get_metrics_single_url(self, metric_type, metric_id):
9495
return self._get_url(metric_type) + '/{0}'.format(self._clean_metric_id(metric_id))
95-
96-
def _get_metrics_data_url(self, metrics_url):
97-
return metrics_url + '/data'
96+
97+
def _get_metrics_raw_url(self, metrics_url):
98+
return metrics_url + '/raw'
99+
100+
def _get_metrics_stats_url(self, metrics_url):
101+
return metrics_url + '/stats'
98102

99103
def _get_metrics_tags_url(self, metrics_url):
100104
return metrics_url + '/tags'
@@ -206,7 +210,7 @@ def put(self, data):
206210

207211
# This isn't transactional, but .. ouh well. One can always repost everything.
208212
for l in r:
209-
self._post(self._get_metrics_data_url(self._get_url(l)), r[l])
213+
self._post(self._get_metrics_raw_url(self._get_url(l)), r[l])
210214

211215
def push(self, metric_type, metric_id, value, timestamp=None, **tags):
212216
"""
@@ -222,12 +226,12 @@ def query_metric(self, metric_type, metric_id, **search_options):
222226
"""
223227
Query for metrics from the server.
224228
225-
Supported search options are [optional]: start, end and buckets
229+
Supported search options are [optional]: start, end
226230
227231
Use methods query_single_gauge and query_single_availability for simple access
228232
"""
229233
return self._get(
230-
self._get_metrics_data_url(
234+
self._get_metrics_raw_url(
231235
self._get_metrics_single_url(metric_type, metric_id)),
232236
**search_options)
233237

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from distutils.core import setup
44

55
setup(name='hawkular-client-python',
6-
version='0.3.4',
6+
version='0.3.5',
77
description='Python client to communicate with Hawkular over HTTP',
88
author='Michael Burman',
99
author_email='miburman@redhat.com',

0 commit comments

Comments
 (0)