forked from elastic/elasticsearch
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set tag for release benchmarks based on fixtures
With this commit we analyze the provided fixtures to determine whether this is a "normal" release benchmark or a release benchmark that is running against an encrypted volume. To tell apart both, we set different tags in Rally. Relates elastic#18
- Loading branch information
1 parent
96dc9a6
commit 0f46df9
Showing
3 changed files
with
46 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import json | ||
import elasticsearch | ||
import elasticsearch.helpers | ||
|
||
|
||
def main(): | ||
count = 0 | ||
es = elasticsearch.Elasticsearch() | ||
docs = elasticsearch.helpers.scan(es, query={"query": {"match_all": {}}}, size=10000) | ||
with open("documents.json", "wt", encoding="UTF-8") as f: | ||
for doc in docs: | ||
if count % 100000 == 0: | ||
print(".", flush=True, end="") | ||
json.dump({"index": {"_index": doc["_index"], "_type": doc["_type"]}}, f) | ||
f.write("\n") | ||
json.dump(doc["_source"], f) | ||
f.write("\n") | ||
count += 1 | ||
print("\nDone") | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters