-
Notifications
You must be signed in to change notification settings - Fork 277
/
perf_args.py
50 lines (46 loc) · 2.43 KB
/
perf_args.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
import argparse
from typing import IO
# Contains the arguments required to run a perf test.
class PerfArgs:
bundle_manifest: IO
stack: str
config: IO
keep: bool
workload: str
workload_options: dict
warmup_iters: int
test_iters: int
insecure: bool
def __init__(self) -> None:
parser = argparse.ArgumentParser(description="Test an OpenSearch Bundle")
parser.add_argument("--bundle-manifest", type=argparse.FileType("r"), help="Bundle Manifest file.", required=True)
parser.add_argument("--stack", dest="stack", help="Stack name for performance test")
parser.add_argument("--component", dest="component", default="OpenSearch", help="Component name that needs to be performance tested")
parser.add_argument("--config", type=argparse.FileType("r"), help="Config file.", required=True)
parser.add_argument(
"--without-security", dest="insecure", action="store_true",
help="Force the security of the cluster to be disabled.", default=False)
parser.add_argument("--keep", dest="keep", action="store_true", help="Do not delete the working temporary directory.")
parser.add_argument("--workload", default="nyc_taxis", help="Mensor (internal client) param - Workload name from OpenSeach Benchmark Workloads")
parser.add_argument("--workload-options", default="{}", help="Mensor (internal client) param - Json object with OpenSearch Benchmark arguments")
parser.add_argument("--warmup-iters", default=0, help="Mensor (internal client) param - Number of times to run a workload before collecting data")
parser.add_argument("--test-iters", default=1, help="Mensor (internal client) param - Number of times to run a workload")
args = parser.parse_args()
self.bundle_manifest = args.bundle_manifest
self.stack = args.stack
self.config = args.config
self.keep = args.keep
self.workload = args.workload
self.workload_options = args.workload_options
self.warmup_iters = args.warmup_iters
self.test_iters = args.test_iters
self.component = args.component
self.insecure = args.insecure