Skip to content

Commit

Permalink
fix: collect_metrics thread initiation (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalii Melnychuk authored Feb 18, 2022
1 parent 77a4265 commit a1ef5bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions agent/maestro_agent/services/running_test/threads_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,26 @@ def start_test(self, run, server_agents):
if self.is_running():
raise Exception("Test is already running, try to stop current one before")

collect_metrics = []
children_threads = []
all_threads = []
if MAESTRO_CSV_WRITER_ENABLED is True:
collect_metrics.append(
ControledThreadInstance(
name=RunningTestThreadsManager.COLLECT_METRICS,
args=(run,),
target=collect_metrics_handler,
)
collect_metrics = ControledThreadInstance(
name=RunningTestThreadsManager.COLLECT_METRICS,
args=(run,),
target=collect_metrics_handler,
)
children_threads.append(collect_metrics)
all_threads.append(collect_metrics)

running_test = ControledThreadInstance(
name=RunningTestThreadsManager.RUNNING_TEST,
target=run_jmeter_client_container_handler,
args=(run, server_agents),
children_threads=collect_metrics,
children_threads=children_threads,
)
pool = ControlledThreadsPool(pool=[running_test])
all_threads.append(running_test)

pool = ControlledThreadsPool(pool=all_threads)
pool.start_all()
self.pool = pool

Expand Down
2 changes: 1 addition & 1 deletion agent/maestro_agent/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def parse_bool(str_value):
os.environ.get("MAESTRO_METRICS_PROCESSING_BULK_SIZE", 100)
)
MAESTRO_CLIENT_AGENT_WAITING_SERVERS_TIMEOUT = int(
os.environ.get("MAESTRO_METRICS_PROCESSING_BULK_SIZE", 120)
os.environ.get("MAESTRO_CLIENT_AGENT_WAITING_SERVERS_TIMEOUT", 120)
)

JMETER_BASE_IMAGE = "maestrojmeter:%s"
Expand Down

0 comments on commit a1ef5bb

Please sign in to comment.