Skip to content

Instantly share code, notes, and snippets.

@theeye-io
Created November 23, 2016 14:00
Show Gist options
  • Save theeye-io/59312b26c30dd91b99cf954643cfc66d to your computer and use it in GitHub Desktop.
Save theeye-io/59312b26c30dd91b99cf954643cfc66d to your computer and use it in GitHub Desktop.
checkResponseTime.bat
echo off
set url=%1
shift
set threshold=%1
shift
set datetime=%date:~-4%_%date:~-7,2%_%date:~-10,2%_%time:~0,2%_%time:~3,2%_%time:~6,2%
set logname=..\tmp\responseTime%datetime%.txt
..\mingw64\bin\curl -o /dev/null -s -w %%{time_total} %url% > %logname%
set /p Result=<%logname%
del %logname%
IF %Result% GEQ %threshold% (
echo High response time %Result%, expected %threshold%
echo failure
) ELSE (
echo Low response time %Result%, expected %threshold%
echo success
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment