Skip to content

Commit

Permalink
Add parallel node collection functionality, via the `parallel_mode=al…
Browse files Browse the repository at this point in the history
…l` config option
  • Loading branch information
michaelsembwever committed Nov 25, 2022
1 parent 5a76a20 commit b0ab791
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ds-collector/collector.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@
#
#hostName=""

# if you want nodes to be collected in parallel, specify
# all – for collecting all nodes at the same time, fastest and dangerous
# rack – not yet supported
# none – every node sequentially, the default behaviour
#
#parallel_mode="none"

# the provided issue id to reference the artifacts
# a generic issueId will be generated if not provided here
#
Expand Down
13 changes: 12 additions & 1 deletion ds-collector/ds-collector
Original file line number Diff line number Diff line change
Expand Up @@ -929,9 +929,20 @@ get_infos() {
for host in ${cassandraNodes} ; do
hostName=$host
if [[ "$hostName" != \#* ]] && [ "$hostName" ] && [[ ! " ${skipNodes[*]} " =~ " $hostName " ]]; then
get_info
if [ "$parallel_mode" = "all" ]; then
get_info 2>&1 > "${host}.log" &
else
get_info
fi
fi
done
if [ "$parallel_mode" = "all" ]; then
wait
for host in ${cassandraNodes} ; do
echo "\n === ${host} ===\n"
awk -v host="${host}" '{print host " " $0}' "${host}.log"
done
fi
else
get_info
fi
Expand Down

0 comments on commit b0ab791

Please sign in to comment.