Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks: Re-factored benchmark infra #7602

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions rest-api-spec/api/abort_benchmark.json

This file was deleted.

21 changes: 21 additions & 0 deletions rest-api-spec/api/benchmark.abort.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"benchmark.abort": {
"documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html",
"methods": ["POST"],
"url": {
"path": "/_bench/_abort/{id}",
"paths": [
"/_bench/_abort/{id}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we always use command after _bench, wouldn't it make sense to omit _ for the second part. In other words use /_bench/abort similar to /_nodes/stats?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

],
"parts": { },
"params": {
"id": {
"required": true,
"type": "boolean",
"description": "The unique ID of the benchmark to abort"
}
}
},
"body": null
}
}
21 changes: 21 additions & 0 deletions rest-api-spec/api/benchmark.pause.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"benchmark.pause": {
"documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html",
"methods": ["POST"],
"url": {
"path": "/_bench/_pause/{id}",
"paths": [
"/_bench/_pause/{id}"
],
"parts": { },
"params": {
"id": {
"required": true,
"type": "boolean",
"description": "The unique ID of the benchmark to pause"
}
}
},
"body": null
}
}
21 changes: 21 additions & 0 deletions rest-api-spec/api/benchmark.resume.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"benchmark.resume": {
"documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html",
"methods": ["POST"],
"url": {
"path": "/_bench/_resume/{id}",
"paths": [
"/_bench/_resume/{id}"
],
"parts": { },
"params": {
"id": {
"required": true,
"type": "boolean",
"description": "The unique ID of the benchmark to resume"
}
}
},
"body": null
}
}
22 changes: 22 additions & 0 deletions rest-api-spec/api/benchmark.status.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"benchmark.status": {
"documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html",
"methods": ["GET"],
"url": {
"path": "/_bench/_status/{id}",
"paths": [
"/_bench/_status",
"/_bench/_status/{id}"
],
"parts": { },
"params": {
"id": {
"required": false,
"type": "list",
"description": "A list of comma-separated ID's to get the status of"
}
}
},
"body": null
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
{
"benchmark" : {
"benchmark.submit": {
"documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html",
"methods": ["PUT"],
"url": {
"path": "/_bench",
"path": "/_bench/_submit",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since interfaces changed, it would be great to update docs as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

"paths": [
"/_bench",
"/{index}/_bench",
"/{index}/{type}/_bench"
"/_bench/_submit",
"/{index}/_bench/_submit",
"/{index}/{types}/_bench/_submit"
],
"parts": {
"index": {
"type" : "list",
"description" : "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"
"required": false,
"type": "list",
"description": "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"
},
"type": {
"type" : "string",
"description" : "The name of the document type"
"types": {
"required": false,
"type": "list",
"description": "A comma-separated list of document types"
}
},
"params": {
Expand All @@ -27,7 +29,8 @@
}
},
"body": {
"description": "The search definition using the Query DSL"
"description": "The search definition using the Query DSL",
"required": true
}
}
}
26 changes: 0 additions & 26 deletions rest-api-spec/api/list_benchmarks.json

This file was deleted.

11 changes: 0 additions & 11 deletions rest-api-spec/test/abort_benchmark/10_basic.yaml

This file was deleted.

111 changes: 111 additions & 0 deletions rest-api-spec/test/benchmark.submit/10_basic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
setup:

- skip:
features: "benchmark"

- do:
index:
index: test_1
type: type_1
id: 1
body: { a: x, b: y, c: z }

- do:
index:
index: test_1
type: type_1
id: 2
body: { a: xx, b: yy, c: zz }

- do:
index:
index: test_1
type: type_1
id: 3
body: { a: xxx, b: yyy, c: zzz }

- do:
indices.refresh: {}

- do:
cluster.health:
wait_for_status: yellow

---
"Submit a benchmark":

- do:
benchmark.submit:
body: {
name: test_benchmark,
verbose: true,
num_executor_nodes: 1,
iterations: 3,
multiplier: 5,
concurrency: 2,
num_slowest: 1,
competitors: [ {
name: test_competitor_1,
concurrency: 3,
requests: [ {
query: { term: { a: x } }
}, {
query: { term: { b: yy } }
} ]
},
{
name: test_competitor_2,
concurrency: 1,
requests: [ {
query: { match: { _all: a } }
}, {
query: { match: { _all: c } }
} ]
}]
}

- match: { benchmark.id: "test_benchmark" }
- match: { benchmark.status: "COMPLETED" }

- match: { benchmark.competitors.test_competitor_1.summary.concurrency: 3 }
- match: { benchmark.competitors.test_competitor_1.summary.total_requested_iterations: 3 }
- match: { benchmark.competitors.test_competitor_1.summary.total_completed_iterations: 3 }
- match: { benchmark.competitors.test_competitor_1.summary.multiplier: 5 }
- gte: { benchmark.competitors.test_competitor_1.summary.avg_warmup_time: 0.0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.min: 0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.max: 0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.mean: 0.0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.qps: 0.0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.millis_per_hit: 0.0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.percentile_10: 0.0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.percentile_25: 0.0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.percentile_50: 0.0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.percentile_75: 0.0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.percentile_90: 0.0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.percentile_99: 0.0 }
- length: { benchmark.competitors.test_competitor_1.summary.slowest: 1 }
- length: { benchmark.competitors.test_competitor_1.iterations: 3 }

- match: { benchmark.competitors.test_competitor_2.summary.concurrency: 1 }
- match: { benchmark.competitors.test_competitor_2.summary.total_requested_iterations: 3 }
- match: { benchmark.competitors.test_competitor_2.summary.total_completed_iterations: 3 }
- match: { benchmark.competitors.test_competitor_2.summary.multiplier: 5 }
- gte: { benchmark.competitors.test_competitor_2.summary.avg_warmup_time: 0.0 }
- gte: { benchmark.competitors.test_competitor_2.summary.statistics.min: 0 }
- gte: { benchmark.competitors.test_competitor_2.summary.statistics.max: 0 }
- gte: { benchmark.competitors.test_competitor_1.summary.statistics.mean: 0.0 }
- gte: { benchmark.competitors.test_competitor_2.summary.statistics.qps: 0.0 }
- gte: { benchmark.competitors.test_competitor_2.summary.statistics.millis_per_hit: 0.0 }
- gte: { benchmark.competitors.test_competitor_2.summary.statistics.percentile_10: 0.0 }
- gte: { benchmark.competitors.test_competitor_2.summary.statistics.percentile_25: 0.0 }
- gte: { benchmark.competitors.test_competitor_2.summary.statistics.percentile_50: 0.0 }
- gte: { benchmark.competitors.test_competitor_2.summary.statistics.percentile_75: 0.0 }
- gte: { benchmark.competitors.test_competitor_2.summary.statistics.percentile_90: 0.0 }
- gte: { benchmark.competitors.test_competitor_2.summary.statistics.percentile_99: 0.0 }
- length: { benchmark.competitors.test_competitor_2.summary.slowest: 1 }
- length: { benchmark.competitors.test_competitor_2.iterations: 3 }

- length: { benchmark.errors: 0 }
- length: { benchmark.competitors: 2 }

33 changes: 0 additions & 33 deletions rest-api-spec/test/benchmark/10_basic.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions rest-api-spec/test/list_benchmarks/10_basic.yaml

This file was deleted.

17 changes: 14 additions & 3 deletions src/main/java/org/elasticsearch/action/ActionModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,16 @@
import org.elasticsearch.action.admin.indices.warmer.get.TransportGetWarmersAction;
import org.elasticsearch.action.admin.indices.warmer.put.PutWarmerAction;
import org.elasticsearch.action.admin.indices.warmer.put.TransportPutWarmerAction;
import org.elasticsearch.action.bench.*;
import org.elasticsearch.action.benchmark.abort.BenchmarkAbortAction;
import org.elasticsearch.action.benchmark.abort.TransportBenchmarkAbortAction;
import org.elasticsearch.action.benchmark.pause.BenchmarkPauseAction;
import org.elasticsearch.action.benchmark.pause.TransportBenchmarkPauseAction;
import org.elasticsearch.action.benchmark.resume.BenchmarkResumeAction;
import org.elasticsearch.action.benchmark.resume.TransportBenchmarkResumeAction;
import org.elasticsearch.action.benchmark.start.BenchmarkStartAction;
import org.elasticsearch.action.benchmark.start.TransportBenchmarkStartAction;
import org.elasticsearch.action.benchmark.status.BenchmarkStatusAction;
import org.elasticsearch.action.benchmark.status.TransportBenchmarkStatusAction;
import org.elasticsearch.action.bulk.BulkAction;
import org.elasticsearch.action.bulk.TransportBulkAction;
import org.elasticsearch.action.bulk.TransportShardBulkAction;
Expand Down Expand Up @@ -308,9 +317,11 @@ protected void configure() {
registerAction(ExplainAction.INSTANCE, TransportExplainAction.class);
registerAction(ClearScrollAction.INSTANCE, TransportClearScrollAction.class);
registerAction(RecoveryAction.INSTANCE, TransportRecoveryAction.class);
registerAction(BenchmarkAction.INSTANCE, TransportBenchmarkAction.class);
registerAction(AbortBenchmarkAction.INSTANCE, TransportAbortBenchmarkAction.class);
registerAction(BenchmarkStartAction.INSTANCE, TransportBenchmarkStartAction.class);
registerAction(BenchmarkAbortAction.INSTANCE, TransportBenchmarkAbortAction.class);
registerAction(BenchmarkStatusAction.INSTANCE, TransportBenchmarkStatusAction.class);
registerAction(BenchmarkResumeAction.INSTANCE, TransportBenchmarkResumeAction.class);
registerAction(BenchmarkPauseAction.INSTANCE, TransportBenchmarkPauseAction.class);

//Indexed scripts
registerAction(PutIndexedScriptAction.INSTANCE, TransportPutIndexedScriptAction.class);
Expand Down
Loading