Skip to content

Commit c3a0c4d

Browse files
committed
[API] Add list_benchmarks back
1 parent 6a775a8 commit c3a0c4d

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module Elasticsearch
2+
module API
3+
module Actions
4+
5+
# Return a list of running benchmarks
6+
#
7+
# @example
8+
#
9+
# client.list_benchmarks
10+
#
11+
# @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string
12+
# to perform the operation on all indices
13+
# @option arguments [String] :type The name of the document type
14+
#
15+
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html
16+
#
17+
def list_benchmarks(arguments={})
18+
method = HTTP_GET
19+
path = "_bench"
20+
params = {}
21+
body = nil
22+
23+
perform_request(method, path, params, body).body
24+
end
25+
end
26+
end
27+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'spec_helper'
2+
3+
describe 'client#list_benchmarks' do
4+
5+
let(:expected_args) do
6+
[
7+
'GET',
8+
'_bench',
9+
{ },
10+
nil
11+
]
12+
end
13+
14+
it 'performs the request' do
15+
expect(client_double.list_benchmarks).to eq({})
16+
end
17+
end

0 commit comments

Comments
 (0)