Fixed a nasty bug that was for debugging but was logging sudo pass to log file! Also fixed the script to work properly for logging random data generation and advanced mode
This commit is contained in:
1 parent
8b6738722b
commit
bc00dca35e
4 files changed
+59
-32
No files matched your search
+3
-3
@@ -15,7 +15,7 @@ bold=$(tput bold)
|
||||
|
||||
log-error() {
|
||||
if [[ -z $2 ]]; then
|
||||
echo -e "${red}${bold}ERROR:${default}${red} $1${default}"
|
||||
echo -e "ERROR: $1"
|
||||
else
|
||||
echo -e "${red}${bold}ERROR:${default}${red} $1${default}"
|
||||
echo -e "${red}${bold}ERROR:${default}${red} $1${default}" >> "$BENCHMARK_LOG_FILE"
|
||||
@@ -24,7 +24,7 @@ log-error() {
|
||||
|
||||
log-warn() {
|
||||
if [[ -z $2 ]]; then
|
||||
echo -e "${gold}${bold}WARN:${default}${gold} $1${default}"
|
||||
echo -e "WARN: $1"
|
||||
else
|
||||
echo -e "${gold}${bold}WARN:${default}${gold} $1${default}"
|
||||
echo -e "${gold}${bold}WARN:${default}${gold} $1${default}" >> "$BENCHMARK_LOG_FILE"
|
||||
@@ -33,7 +33,7 @@ log-warn() {
|
||||
|
||||
log-info() {
|
||||
if [[ -z $2 ]]; then
|
||||
echo -e "${cyan}${bold}INFO:${default}${cyan} $1${default}"
|
||||
echo -e "INFO: $1"
|
||||
else
|
||||
echo -e "${cyan}${bold}INFO:${default}${cyan} $1${default}"
|
||||
echo -e "${cyan}${bold}INFO:${default}${cyan} $1${default}" >> "$BENCHMARK_LOG_FILE"
|
||||
|
||||
@@ -105,10 +105,8 @@ parse-arguments() {
|
||||
show-properties() {
|
||||
log-info "Using the following settings to randomly populate the DynamoDB benchmarking table:"
|
||||
cat <<-EOF
|
||||
${cyan}
|
||||
ATTRIBUTES=$ATTRIBUTES
|
||||
TABLE_NAME=$TABLE_NAME
|
||||
${default}
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -178,3 +176,5 @@ while [[ $items_written -lt $ITEMS ]]; do
|
||||
log-info "Sleeping for 2 seconds to avoid the partition throughput limits..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo -e "\n\n\nSuccessfully wrote $items_written randomly generated items to DynamoDB!"
|
||||
+5
-1
@@ -1,9 +1,13 @@
|
||||
#!/bin/bash
|
||||
TERMINAL_HEIGHT=$(tput lines)
|
||||
BOX_HEIGHT=$(printf "%.0f" "$(echo "scale=2; $TERMINAL_HEIGHT * .5" | bc)")
|
||||
CHECKBOX_HEIGHT=$(printf "%.0f" "$(echo "scale=2; $TERMINAL_HEIGHT * .5" | bc)")
|
||||
TAIL_BOX_HEIGHT=$(printf "%.0f" "$(echo "scale=2; $TERMINAL_HEIGHT * .8" | bc)")
|
||||
|
||||
TERMINAL_WIDTH=$(tput cols)
|
||||
BOX_WIDTH=$(printf "%.0f" "$(echo "scale=2; $TERMINAL_WIDTH * .75" | bc)")
|
||||
CHECKBOX_WIDTH=$(printf "%.0f" "$(echo "scale=2; $TERMINAL_WIDTH * .5" | bc)")
|
||||
TAIL_BOX_WIDTH=$(printf "%.0f" "$(echo "scale=2; $TERMINAL_WIDTH * .85" | bc)")
|
||||
|
||||
msg-box() {
|
||||
whiptail --fb --msgbox "$1" "$BOX_HEIGHT" "$BOX_WIDTH"
|
||||
@@ -20,7 +24,7 @@ show-tail-box() {
|
||||
trap "kill $2 2> /dev/null" EXIT
|
||||
|
||||
while kill -0 "$2" 2> /dev/null; do
|
||||
dialog --title "$1" --exit-label "Finished" --tailbox "$3" "$BOX_HEIGHT" "$BOX_WIDTH"
|
||||
dialog --title "$1" --exit-label "Finished" --tailbox "$3" "$TAIL_BOX_HEIGHT" "$TAIL_BOX_WIDTH"
|
||||
done
|
||||
|
||||
clear
|
||||
|
||||
Reference in new issue
Block a user