Skip to content

Instantly share code, notes, and snippets.

@dliappis
Last active March 16, 2018 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dliappis/f90f30cd605ce9a115799296e044af42 to your computer and use it in GitHub Desktop.
Save dliappis/f90f30cd605ce9a115799296e044af42 to your computer and use it in GitHub Desktop.
Example rally track to use one type per multiple indices and one index with a custom type field
{
"mappings": {
"docs": {
"properties": {
"type": {
"type": "keyword"
},
"@timestamp": {
"format": "epoch_second",
"type": "date"
},
"clientip": {
"type": "ip"
},
"request": {
"type": "text",
"fields": {
"raw": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"status": {
"type": "integer"
},
"size": {
"type": "integer"
}
}
}
}
}
{"type": "wclogs1", "@timestamp": 893964617, "clientip":"40.135.0.0", "request": "GET /images/hm_bg.jpg HTTP/1.0", "status": 200, "size": 24736}
{"type": "wclogs1", "@timestamp": 893964653, "clientip":"232.0.0.0", "request": "GET /images/hm_bg.jpg HTTP/1.0", "status": 200, "size": 24736}
{"type": "wclogs2", "@timestamp": 893964679, "clientip":"247.37.0.0", "request": "GET /french/splash_inet.html HTTP/1.0", "status": 200, "size": 3781}
{"type": "wclogs2", "@timestamp": 893964703, "clientip":"247.37.0.0", "request": "GET /french/images/nav_venue_off.gif HTTP/1.0", "status": 304, "size": 0}
{"@timestamp": 893964617, "clientip":"40.135.0.0", "request": "GET /images/hm_bg.jpg HTTP/1.0", "status": 200, "size": 24736}
{"@timestamp": 893964653, "clientip":"232.0.0.0", "request": "GET /images/hm_bg.jpg HTTP/1.0", "status": 200, "size": 24736}
{"@timestamp": 893964679, "clientip":"247.37.0.0", "request": "GET /french/splash_inet.html HTTP/1.0", "status": 200, "size": 3781}
{"@timestamp": 893964703, "clientip":"247.37.0.0", "request": "GET /french/images/nav_venue_off.gif HTTP/1.0", "status": 304, "size": 0}
{
"mappings": {
"type": {
"properties": {
"@timestamp": {
"format": "epoch_second",
"type": "date"
},
"clientip": {
"type": "ip"
},
"request": {
"type": "text",
"fields": {
"raw": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"status": {
"type": "integer"
},
"size": {
"type": "integer"
}
}
}
}
}
{
"description": "multiple indices, one type per index",
"indices": [
{
"name": "wclogs1",
"auto-managed": false,
"body": "mapping-index.json",
"types": ["type"]
},
{
"name": "wclogs2",
"auto-managed": false,
"body": "mapping-index.json",
"types": ["type"]
},
{
"name": "combinedlogs",
"auto-managed": false,
"body": "custom-type.json",
"types": ["docs"]
}
],
"corpora": [
{
"name": "one-type-per-index",
"target-type": "type",
"documents": [
{
"source-file": "documents-idx1.json",
"document-count": 2,
"target-index": "wclogs1",
"uncompressed-bytes": 251
},
{
"source-file": "documents-idx2.json",
"document-count": 2,
"target-index": "wclogs2",
"uncompressed-bytes": 269
}
]
},
{
"name": "combineddocbatch",
"target-type": "docs",
"documents": [
{
"source-file": "documents-combined.json",
"document-count": 4,
"target-index": "combinedlogs",
"uncompressed-bytes": 596
}
]
}
],
"challenges": [
{
"name": "one-type-multiple-indices",
"description": "Benchmark multiple indices with one type",
"default": true,
"schedule": [
{
"name": "delete-indices-with-one-type",
"index": ["wclogs1", "wclogs2"],
"operation": "delete-index"
},
{
"name": "create-firstindex",
"operation": {
"index": "wclogs1",
"operation-type": "create-index",
"settings": {
"index.number_of_replicas": 0
}
}
},
{
"name": "create-secondindex",
"operation": {
"index": "wclogs2",
"operation-type": "create-index",
"settings": {
"index.number_of_replicas": 0
}
}
},
{
"name": "get-health-indices-with-one-type",
"operation": {
"index": "wclogs*",
"operation-type": "cluster-health",
"request-params": {
"wait_for_status": "yellow"
}
}
},
{
"name": "bulk-indices-with-one-type",
"operation": {
"operation-type": "bulk",
"corpora": ["one-type-per-index"],
"bulk-size": 2
},
"warmup-time-period": 5,
"clients": 1
}
]
},
{
"name": "custom-type-in-one-index",
"description": "Benchmark custom type field with only one index",
"schedule": [
{
"name": "delete-thirdindex",
"index": "combinedlogs",
"operation": "delete-index"
},
{
"name": "create-thirdindex",
"operation": {
"index": "combinedlogs",
"operation-type": "create-index",
"settings": {
"index.number_of_replicas": 0
}
}
},
{
"name": "gethealth-thirdindex",
"operation": {
"index": "combinedlogs",
"operation-type": "cluster-health",
"request-params": {
"wait_for_status": "yellow"
}
}
},
{
"name": "bulkindex-thirdindex",
"operation": {
"operation-type": "bulk",
"corpora": ["combineddocbatch"],
"bulk-size": 2
},
"warmup-time-period": 5,
"clients": 1
}
]
}
]
}
@dliappis
Copy link
Author

dliappis commented Mar 15, 2018

There are two challenges here.

Example, to benchmark multiple indices with one type:

esrally --track-path=$PWD --on-error=abort --preserve-install=true --distribution-version=6.2.2 --challenge=one-type-multiple-indices

Example to benchmark one index with a custom type field:

esrally --track-path=$PWD --on-error=abort --preserve-install=true --distribution-version=6.2.2 --challenge=custom-type-in-one-index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment