Skip to content

Commit

Permalink
Don't retrieve meta-data by default
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmitterdorfer committed Mar 25, 2020
1 parent bf4ef02 commit 4c2e78a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
12 changes: 12 additions & 0 deletions docs/migrate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ Minimum Python version is 3.8.0

Rally 1.5.0 requires Python 3.8.0. Check the :ref:`updated installation instructions <install_python>` for more details.

Meta-Data for queries are omitted
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Rally 1.5.0 does not determine query meta-data anymore by default to reduce the risk of client-side bottlenecks. The following meta-data fields are affected:

* ``hits``
* ``hits_relation``
* ``timed_out``
* ``took``

If you still want to retrieve them (risking skewed results due to additional overhead), set the new property ``detailed-results`` to ``true`` for any operation of type ``search``.

Runner API uses asyncio
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion docs/track.rst
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ With the operation type ``search`` you can execute `request body searches <http:
2. Rally will not attempt to serialize the parameters and pass them as is. Always use "true" / "false" strings for boolean parameters (see example below).

* ``body`` (mandatory): The query body.
* ``detailed-results`` (optional, defaults to ``true``): Records more detailed meta-data about queries. As it analyzes the corresponding response in more detail, this might incur additional overhead which can skew measurement results. Set this value to ``false`` for queries that return within single digit milliseconds to increase measurement accuracy. This flag is ineffective for scroll queries.
* ``detailed-results`` (optional, defaults to ``false``): Records more detailed meta-data about queries. As it analyzes the corresponding response in more detail, this might incur additional overhead which can skew measurement results. This flag is ineffective for scroll queries.
* ``pages`` (optional): Number of pages to retrieve. If this parameter is present, a scroll query will be executed. If you want to retrieve all result pages, use the value "all".
* ``results-per-page`` (optional): Number of documents to retrieve per page for scroll queries.

Expand Down
9 changes: 8 additions & 1 deletion esrally/driver/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,13 @@ class Query(Runner):
* `cache`: True iff the request cache should be used.
* `body`: Query body
The following parameters are optional:
* `detailed-results` (default: ``False``): Records more detailed meta-data about queries. As it analyzes the
corresponding response in more detail, this might incur additional
overhead which can skew measurement results. This flag is ineffective
for scroll queries (detailed meta-data are always returned).
If the following parameters are present in addition, a scroll query will be issued:
* `pages`: Number of pages to retrieve at most for this scroll. If a scroll query does yield less results than the specified number of
Expand Down Expand Up @@ -765,7 +772,7 @@ async def request_body_query(self, es, params):
index = params.get("index", "_all")
body = mandatory(params, "body", self)
doc_type = params.get("type")
detailed_results = params.get("detailed-results", True)
detailed_results = params.get("detailed-results", False)
params = request_params

# disable eager response parsing - responses might be huge thus skewing results
Expand Down
5 changes: 5 additions & 0 deletions tests/driver/runner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ async def test_query_match_only_request_body_defined(self, es):
query_runner = runner.Query()

params = {
"detailed-results": True,
"cache": True,
"body": {
"query": {
Expand Down Expand Up @@ -1144,6 +1145,7 @@ async def test_query_match_using_request_params(self, es):
query_runner = runner.Query()
params = {
"cache": False,
"detailed-results": True,
"body": None,
"request-params": {
"q": "user:kimchy"
Expand Down Expand Up @@ -1246,6 +1248,7 @@ async def test_query_hits_total_as_number(self, es):

params = {
"cache": True,
"detailed-results": True,
"body": {
"query": {
"match_all": {}
Expand Down Expand Up @@ -1300,6 +1303,7 @@ async def test_query_match_all(self, es):

params = {
"index": "unittest",
"detailed-results": True,
"cache": None,
"body": {
"query": {
Expand Down Expand Up @@ -1355,6 +1359,7 @@ async def test_query_match_all_doc_type_fallback(self, es):
params = {
"index": "unittest",
"type": "type",
"detailed-results": True,
"cache": None,
"body": {
"query": {
Expand Down

0 comments on commit 4c2e78a

Please sign in to comment.