Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: maximum response time #150

Open
tkellen opened this issue Feb 11, 2019 · 1 comment
Open

feature request: maximum response time #150

tkellen opened this issue Feb 11, 2019 · 1 comment

Comments

@tkellen
Copy link

tkellen commented Feb 11, 2019

Would you accept a PR that introduces a max-time option which forces requests to fail after a user defined duration? I am testing an API that has numerous endpoints which return responses after minutes (or even hours) of processing. I'm writing a suite to raise visibility on this issue and I'd like to eliminate my usage of this wrapper (which kills siege itself if there is no output for a defined period).

#!/bin/bash

_terminate_children() {
        trap "exit 143" SIGTERM && kill -- -$$
}

trap _terminate_children SIGINT SIGTERM

tout="$1"
shift
eval $@ | tee >(while :; do
   read -t "$tout"
   case $? in
      0) : ;;
      1) break ;;
      *) _terminate_children ;;
   esac
done)
exit ${PIPESTATUS[0]}
@JoeDog
Copy link
Owner

JoeDog commented Feb 11, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants