Skip to content

Commit

Permalink
bench: update analysis run fixup to the new AWS log results layout
Browse files Browse the repository at this point in the history
  • Loading branch information
deepfire committed Jan 17, 2022
1 parent d487401 commit 971ac47
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
15 changes: 10 additions & 5 deletions nix/workbench/analyse.sh
@@ -1,18 +1,19 @@
usage_analyse() {
usage "analyse" "Analyse cluster runs" <<EOF
standard RUN-NAME Standard batch of analyses: block-propagation, and
machine-timeline
block-propagation RUN-NAME
Block propagation analysis for the entire cluster.
machine-timeline RUN-NAME MACH-NAME
machine-timeline RUN-NAME [MACH-NAME=node-1]
Produce a general performance timeline for MACH-NAME
Options of 'analyse' command:
--chain-filters F Read chain filters to apply from the F JSON file
--reanalyse Skip the preparatory steps and launch 'locli' directly
--block-fullness-above F
Ignore blocks with fullness below (0 <= F <= 1.0)
--since-slot SLOT Ignore data before given slot
--until-slot SLOT Ignore data past given slot
--dump-logobjects Dump the intermediate data: lifted log objects
EOF
}

Expand All @@ -28,6 +29,10 @@ do case "$1" in
local op=${1:-$(usage_analyse)}; shift

case "$op" in
standard | std )
analyse ${self_args[*]} block-propagation "$@"
analyse ${self_args[*]} --reanalyse machine-timeline "$@"
;;
block-propagation | bp )
local usage="USAGE: wb analyse $op [RUN-NAME=current].."

Expand Down
27 changes: 15 additions & 12 deletions nix/workbench/run.sh
Expand Up @@ -76,19 +76,22 @@ case "$op" in

if test ! -f "$dir"/profile.json
then # Legacy run structure, fix up:
msg "fixing up legacy run in: $dir"
jq '.meta.profile_content' "$dir"/meta.json > "$dir"/profile.json
if test -z "$(ls -d "$dir"/logs/node-*)"
then msg "fixing up a legacy cardano-ops run in: $dir"
local topdirs=$(ls -d "$dir"/logs-*/ 2>/dev/null || true)
local anadirs=$(ls -d "$dir"/analysis/logs-*/ 2>/dev/null || true)
if test -n "$topdirs"
then for logdir in $topdirs
do local fixed=$(basename "$logdir" | cut -c6-)
mv "$logdir" "$dir"/$fixed; done
elif test -n "$anadirs"
then for logdir in $anadirs
do local fixed=$(basename "$logdir" | cut -c6-)
mv "$logdir" "$dir"/analysis/$fixed; done; fi
else msg "fixing up a cardano-ops run in: $dir"
fi

local topdirs=$(ls -d "$dir"/logs-*/ 2>/dev/null || true)
local anadirs=$(ls -d "$dir"/analysis/logs-*/ 2>/dev/null || true)
if test -n "$topdirs"
then for logdir in $topdirs
do local fixed=$(basename "$logdir" | cut -c6-)
mv "$logdir" "$dir"/$fixed; done
elif test -n "$anadirs"
then for logdir in $anadirs
do local fixed=$(basename "$logdir" | cut -c6-)
mv "$logdir" "$dir"/analysis/$fixed; done; fi
jq '.meta.profile_content' "$dir"/meta.json > "$dir"/profile.json

jq_fmutate "$dir"/env.json '. *
{ type: "legacy"
Expand Down

0 comments on commit 971ac47

Please sign in to comment.