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

add run_id to es docs #229

Merged
merged 6 commits into from
Nov 17, 2020
Merged
Changes from 2 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
6 changes: 6 additions & 0 deletions snafu/run_snafu.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def main():
default=logging.INFO, help='enables verbose wrapper debugging info')
parser.add_argument(
'-t', '--tool', help='Provide tool name', required=True)
parser.add_argument(
'--run-id', help='Run ID to unify benchmark results in ES'
)
index_args, unknown = parser.parse_known_args()
index_args.index_results = False
index_args.prefix = "snafu-%s" % index_args.tool
Expand Down Expand Up @@ -170,10 +173,13 @@ def get_valid_es_document(action, index, index_args):
es_index = index_args.prefix + '-' + index
else:
es_index = index_args.prefix

es_valid_document = {"_index": es_index,
"_op_type": "create",
"_source": action,
"_id": ""}
if index_args.run_id:
es_valid_document['run_id'] = index_args.run_id
es_valid_document["_id"] = hashlib.sha256(str(action).encode()).hexdigest()
document_size_bytes = sys.getsizeof(es_valid_document)
index_args.document_size_capacity_bytes += document_size_bytes
Expand Down