Skip to content

Commit 32e6683

Browse files
authored
Merge pull request #19 from joanhey/resp-length
Show response length in check.sh
2 parents be0f200 + 3c15e6b commit 32e6683

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

check.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
. ./benchmark.config
44
. ./base/option_target.sh
55

6-
OK='\U2714'
7-
ERROR='\U274C'
8-
6+
# Colors
97
GREEN='\033[0;32m'
108
RED='\033[0;31m'
119
NC='\033[0m' # No Color
@@ -21,18 +19,18 @@ do
2119

2220
# expected to get the Hello World! + libs/output_data.php
2321
if ! [[ "$url_output" =~ ^('Hello World!')(.*)(([0-9]*):(([0-9]+([.][0-9]*)?|[.][0-9]+)):([0-9]*))$ ]]; then
24-
echo -e "${RED}${ERROR} $fw ${NC}"
22+
echo -e "${RED} $fw ${NC}"
2523
echo "$url"
2624

2725
if [ -x "$(command -v w3m)" ]; then
2826
echo "$url_output" | w3m -dump -T text/html
2927
else
3028
echo "$url_output"
3129
fi
32-
30+
3331
FAIL=1
3432
else
35-
echo -e "${GREEN}${OK} $fw ${NC}"
33+
echo -e "${GREEN} $fw ${NC} \t ${#url_output} bytes"
3634
fi
3735
fi
3836
done

libs/output_data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
printf(
4-
"\n%' 8d:%f:%d",
4+
"\n%' 8d:%f:%'.03d",
55
memory_get_peak_usage(),
66
microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'],
77
count(get_included_files()) - 1

0 commit comments

Comments
 (0)