Created
November 25, 2016 17:33
-
-
Save theeye-io/ebefc07b69eedb0a7c67d5626b0d76d7 to your computer and use it in GitHub Desktop.
batch script to check timeout using curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo off | |
set arg1=%1 | |
set arg2=%2 | |
shift | |
shift | |
..\mingw64\bin\curl -o /dev/null -s -w %%{time_total} %arg1% > ..\tmp\rtime2.txt | |
set /p VAR=<..\tmp\rtime2.txt | |
del ..\tmp\rtime2.txt | |
IF %VAR% GEQ %arg2% ( | |
echo Response time alto! %VAR%, expected %arg2% | |
echo { "state":"failure", "data":%VAR% } | |
) ELSE ( | |
echo Response time bajo! %VAR%, expected %arg2% | |
echo { "state":"success", "data":%VAR% } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment