Skip to content

Commit

Permalink
Fixes API call for get_rates.
Browse files Browse the repository at this point in the history
 /stats endpoint shouldn't be called when bucket_duration is nil.
  • Loading branch information
josejulio committed Oct 12, 2016
1 parent b4cf17e commit 5ee7ef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hawkular/metrics/metric_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def initialize(client)
# @return [Array[Hash]] rate points
def get_rate(id, starts: nil, ends: nil, bucket_duration: nil)
path = "/#{@resource}/#{ERB::Util.url_encode(id)}/rate"
path << '/stats' unless bucket_duration.nil? && @legacy_api
path << '/stats' unless bucket_duration.nil? || @legacy_api
params = { start: starts, end: ends, bucketDuration: bucket_duration }
resp = @client.http_get(path + '?' + encode_params(params))
# API returns no content (empty Hash) instead of empty array
Expand Down

0 comments on commit 5ee7ef5

Please sign in to comment.