Skip to content

Commit

Permalink
Dogapi::Client#batch_metrics should return the reponse from API
Browse files Browse the repository at this point in the history
  • Loading branch information
yyuu committed Feb 27, 2015
1 parent ff1ccd2 commit 5244729
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/dogapi/facade.rb
Expand Up @@ -94,7 +94,7 @@ def batch_metrics()
@metric_svc.switch_to_batched
begin
yield
@metric_svc.flush_buffer
@metric_svc.flush_buffer # flush_buffer should returns the response from last API call
ensure
@metric_svc.switch_to_single
end
Expand Down
3 changes: 2 additions & 1 deletion lib/dogapi/v1/metric.rb
Expand Up @@ -38,8 +38,9 @@ def submit_to_buffer(metric, points, scope, options = {})
end

def flush_buffer()
self.upload(@buffer)
payload = @buffer
@buffer = nil
self.upload(payload)
end

alias :submit :submit_to_api
Expand Down

0 comments on commit 5244729

Please sign in to comment.