我要执行Benckmark测试,并遵循Elasticsearch documentation。
/bin/elasticsearch --node.bench true
curl -XPUT 'localhost:9200/_bench/?pretty=true' -d '{
"name": "my_benchmark",
"competitors": [ {
"name": "my_competitor",
"requests": [ {
"query": {
"match": { "_all": "a*" }
}
} ]
} ]
}'
但我得到了异常(exception)。
{ "error" : "InvalidIndexNameException[[_bench] Invalid index name
[_bench], must not start with '_']", "status" : 400 }
我究竟做错了什么。
最佳答案
我检查了1.4.2版中新下载的elasticsearch,并得到了与您相同的结果。
然后,我从github的主分支中编译了 flex 搜索,并且该搜索有效。对于您的 curl ,我得到以下答复:
{
"status" : "COMPLETE",
"errors" : [ ],
"competitors" : {
"my_competitor" : {
"summary" : {
"nodes" : [
"Cable" ],
"total_iterations" : 5,
"completed_iterations" : 5,
"total_queries" : 5000,
"concurrency" : 5,
"multiplier" : 1000,
"avg_warmup_time" : 0.0,
"statistics" : {
"min" : 1,
"max" : 1,
"mean" : 1.0,
"qps" : 1000.0,
"std_dev" : 0.0,
"millis_per_hit" : 0.0,
"percentile_10" : 1.0,
"percentile_25" : 1.0,
"percentile_50" : 1.0,
"percentile_75" : 1.0,
"percentile_90" : 1.0,
"percentile_99" : 1.0
}
}
}
}
}
对于更简单的 curl ,我得到了:
curl -XGET 'localhost:9200/_bench?pretty'
{ }
因此,该功能似乎处于试验阶段,因此尚未包含在任何稳定版本中。
我想文档标题中的引用[master]不是巧合;)
关于elasticsearch - 如何在Elasticsearch中对执行进行基准测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27432527/