Skip to content

Commit

Permalink
Mithril signers section only in main views
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorBenson committed Aug 2, 2024
1 parent 9757078 commit 7fdc0dc
Showing 1 changed file with 56 additions and 56 deletions.
112 changes: 56 additions & 56 deletions scripts/cnode-helper-scripts/gLiveView.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1452,66 +1452,66 @@ while true; do
closeRow
fi
fi
fi

if [[ "${MITHRIL_SIGNER_ENABLED}" == "Y" ]] ; then
# Mithril Signer Section
mithrilSignerVars
printf "${mithrildivider}\n" && ((line++))
get_metric_value() {
local metric_name="$1"
local metric_value
while IFS= read -r line; do
if [[ $line =~ ${metric_name}[[:space:]]+([0-9]+) ]]; then
metric_value="${BASH_REMATCH[1]}"
echo "$metric_value"
return
fi
done <<< "$mithrilSignerMetrics"
}
metrics=(
"runtime_cycle_total_since_startup"
"signer_registration_success_last_epoch"
"signer_registration_success_since_startup"
"signer_registration_total_since_startup"
"signature_registration_success_last_epoch"
"signature_registration_success_since_startup"
"signature_registration_total_since_startup"
)
cycle_total_VAL=$(get_metric_value "runtime_cycle_total_since_startup")
signer_reg_epoch_VAL=$(get_metric_value "signer_registration_success_last_epoch")
signer_reg_success_VAL=$(get_metric_value "signer_registration_success_since_startup")
signer_reg_total_VAL=$(get_metric_value "signer_registration_total_since_startup")
signatures_epoch_VAL=$(get_metric_value "signature_registration_success_last_epoch")
signatures_reg_success_VAL=$(get_metric_value "signature_registration_success_since_startup")
signatures_reg_total_VAL=$(get_metric_value "signature_registration_total_since_startup")
if [[ ${VERBOSE} = "Y" ]]; then
printf "${VL} Status : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signerServiceStatus"
printf " : Registered Epoch : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_epoch_VAL"
closeRow
printf "${VL} Cycles : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$cycle_total_VAL"
printf " : Signing in Epoch : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_epoch_VAL"
closeRow
printf "${VL} Signatures : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_reg_success_VAL"
printf " : Total Signatures : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signatures_reg_total_VAL"
closeRow
printf "${VL} Registered : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_success_VAL"
printf " : Registered Total : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_total_VAL"
closeRow
else
printf "${VL} Status : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signerServiceStatus"
printf " : Registered Epoch : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_epoch_VAL"
closeRow
printf "${VL} Cycles : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$cycle_total_VAL"
printf " : Signing in Epoch : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_epoch_VAL"
closeRow
printf "${VL} Signatures : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_reg_success_VAL"
printf " : Total Signatures : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signatures_reg_total_VAL"
closeRow
if [[ "${MITHRIL_SIGNER_ENABLED}" == "Y" ]]; then
# Mithril Signer Section
mithrilSignerVars
printf "${mithrildivider}\n" && ((line++))
get_metric_value() {
local metric_name="$1"
local metric_value
while IFS= read -r line; do
if [[ $line =~ ${metric_name}[[:space:]]+([0-9]+) ]]; then
metric_value="${BASH_REMATCH[1]}"
echo "$metric_value"
return
fi
done <<< "$mithrilSignerMetrics"
}
metrics=(
"runtime_cycle_total_since_startup"
"signer_registration_success_last_epoch"
"signer_registration_success_since_startup"
"signer_registration_total_since_startup"
"signature_registration_success_last_epoch"
"signature_registration_success_since_startup"
"signature_registration_total_since_startup"
)
cycle_total_VAL=$(get_metric_value "runtime_cycle_total_since_startup")
signer_reg_epoch_VAL=$(get_metric_value "signer_registration_success_last_epoch")
signer_reg_success_VAL=$(get_metric_value "signer_registration_success_since_startup")
signer_reg_total_VAL=$(get_metric_value "signer_registration_total_since_startup")
signatures_epoch_VAL=$(get_metric_value "signature_registration_success_last_epoch")
signatures_reg_success_VAL=$(get_metric_value "signature_registration_success_since_startup")
signatures_reg_total_VAL=$(get_metric_value "signature_registration_total_since_startup")
if [[ ${VERBOSE} = "Y" ]]; then
printf "${VL} Status : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signerServiceStatus"
printf " : Registered Epoch : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_epoch_VAL"
closeRow
printf "${VL} Cycles : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$cycle_total_VAL"
printf " : Signing in Epoch : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_epoch_VAL"
closeRow
printf "${VL} Signatures : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_reg_success_VAL"
printf " : Total Signatures : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signatures_reg_total_VAL"
closeRow
printf "${VL} Registered : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_success_VAL"
printf " : Registered Total : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_total_VAL"
closeRow
else
printf "${VL} Status : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signerServiceStatus"
printf " : Registered Epoch : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_epoch_VAL"
closeRow
printf "${VL} Cycles : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$cycle_total_VAL"
printf " : Signing in Epoch : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_epoch_VAL"
closeRow
printf "${VL} Signatures : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_reg_success_VAL"
printf " : Total Signatures : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signatures_reg_total_VAL"
closeRow
fi
fi
fi



[[ ${check_peers} = "true" ]] && check_peers=false && show_peers=true && clrScreen && continue

echo "${bdivider}" && ((line++))
Expand Down

0 comments on commit 7fdc0dc

Please sign in to comment.