Skip to content
Snippets Groups Projects
Commit 0569d0ea authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

fix grep in value loop

parent e68f10ce
No related branches found
No related tags found
1 merge request!156fix grep in value loop
...@@ -145,7 +145,7 @@ case "${sMode}" in ...@@ -145,7 +145,7 @@ case "${sMode}" in
ph.status "Couchdb :: Http request methods" ph.status "Couchdb :: Http request methods"
printf "%30s %10s %10s\n" "Property" "Counter" "Delta" | tr ' ' '_' printf "%30s %10s %10s\n" "Property" "Counter" "Delta" | tr ' ' '_'
for myVar in $( grep "[a-z\_]" <<< "$_status" | cut -f 1 -d ':' ) for myVar in $( grep "^[a-z\_]" <<< "$_status" | cut -f 1 -d ':' )
do do
_iValue=$( grep "^${myVar}:" <<< "$_status" | cut -f 2 -d ':' ) _iValue=$( grep "^${myVar}:" <<< "$_status" | cut -f 2 -d ':' )
_label="couchdb-hp-${myVar//_/-}" # underscrore to minus _label="couchdb-hp-${myVar//_/-}" # underscrore to minus
...@@ -173,9 +173,9 @@ case "${sMode}" in ...@@ -173,9 +173,9 @@ case "${sMode}" in
ph.status "Couchdb :: Http request methods" ph.status "Couchdb :: Http request methods"
printf "%10s %10s %10s\n" "Method" "Counter" "Delta" | tr ' ' '_' printf "%10s %10s %10s\n" "Method" "Counter" "Delta" | tr ' ' '_'
for myVar in $( grep "[A-Z]" <<< "$_status" | cut -f 1 -d ':' ) for myVar in $( grep "^[A-Z]" <<< "$_status" | cut -f 1 -d ':' )
do do
_iValue=$( grep "$myVar" <<< "$_status" | cut -f 2 -d ':' ) _iValue=$( grep "^$myVar:" <<< "$_status" | cut -f 2 -d ':' )
_label="couchdb-hm-${myVar//_/-}" # underscrore to minus _label="couchdb-hm-${myVar//_/-}" # underscrore to minus
_iDelta=$( ph.perfdeltaspeed "${_label}" $_iValue) _iDelta=$( ph.perfdeltaspeed "${_label}" $_iValue)
printf "%10s %10s %10s per sec\n" "$myVar" $_iValue $_iDelta printf "%10s %10s %10s per sec\n" "$myVar" $_iValue $_iDelta
...@@ -202,9 +202,9 @@ case "${sMode}" in ...@@ -202,9 +202,9 @@ case "${sMode}" in
ph.status "Couchdb :: Http status codes" ph.status "Couchdb :: Http status codes"
printf "%10s %10s %10s\n" "Status" "Counter" "Delta" | tr ' ' '_' printf "%10s %10s %10s\n" "Status" "Counter" "Delta" | tr ' ' '_'
for myVar in $( grep "[1-9]" <<< "$_status" | cut -f 1 -d ':' ) for myVar in $( grep "^[1-9]" <<< "$_status" | cut -f 1 -d ':' )
do do
_iValue=$( grep "$myVar" <<< "$_status" | cut -f 2 -d ':' ) _iValue=$( grep "^$myVar:" <<< "$_status" | cut -f 2 -d ':' )
_label="couchdb-hs-${myVar//_/-}" # underscrore to minus _label="couchdb-hs-${myVar//_/-}" # underscrore to minus
_iDelta=$( ph.perfdeltaspeed "${_label}" $_iValue) _iDelta=$( ph.perfdeltaspeed "${_label}" $_iValue)
printf "%10s %10s %10s per sec\n" "$myVar" $_iValue $_iDelta printf "%10s %10s %10s per sec\n" "$myVar" $_iValue $_iDelta
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment