Skip to content

Commit

Permalink
Change the way telemetry parameters are parsed
Browse files Browse the repository at this point in the history
Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Aug 10, 2023
1 parent 2db9c0e commit 79f1d8f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9.17
11 changes: 5 additions & 6 deletions src/test_workflow/benchmark_test/benchmark_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ class BenchmarkArgs:
benchmark_config: IO
user_tag: str
target_hosts: str
capture_node_stat: bool
capture_segment_replication_stat: bool
telemetry: list
logging_level: int

def __init__(self) -> None:
Expand Down Expand Up @@ -90,9 +89,10 @@ def __init__(self) -> None:
parser.add_argument("--workload-params", dest="workload_params",
help="With this parameter you can inject variables into workloads. Parameters differs "
"for each workload type. e.g., --workload-params \"number_of_replicas:1,number_of_shards:5\"")
parser.add_argument("--capture-node-stat", dest="capture_node_stat", action="store_true",
parser.add_argument("--capture-node-stat", dest="telemetry", action="append_const", const="node-stats",
help="Enable opensearch-benchmark to capture node stat metrics such as cpu, mem, jvm etc as well.")
parser.add_argument("--capture_segment_replication_stat", dest="capture_segment_replication_stat", action="store_true",
parser.add_argument("--capture_segment_replication_stat", dest="telemetry", action="append_const",
const="segment-replication-stats",
help="Enable opensearch-benchmark to segment_replication stat metrics such as replication lag.")
parser.add_argument("-v", "--verbose", help="Show more verbose output.", action="store_const", default=logging.INFO,
const=logging.DEBUG, dest="logging_level")
Expand Down Expand Up @@ -121,6 +121,5 @@ def __init__(self) -> None:
self.user_tag = args.user_tag if args.user_tag else None
self.additional_config = json.dumps(args.additional_config) if args.additional_config is not None else None
self.use_50_percent_heap = args.use_50_percent_heap
self.capture_node_stat = args.capture_node_stat
self.capture_segment_replication_stat = args.capture_segment_replication_stat
self.telemetry = args.telemetry
self.logging_level = args.logging_level
9 changes: 4 additions & 5 deletions src/test_workflow/benchmark_test/benchmark_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ def __init__(
user_tag = f"--user-tag=\"{args.user_tag}\""
self.command += f" {user_tag}"

self.command += " --telemetry="
if args.capture_node_stat:
self.command += "node-stats,"
if args.capture_segment_replication_stat:
self.command += "segment-replication-stats,"
if args.telemetry:
self.command += " --telemetry="
for value in args.telemetry:
self.command += f"{value},"

def execute(self) -> None:
if self.security:
Expand Down

0 comments on commit 79f1d8f

Please sign in to comment.