Skip to content

Instantly share code, notes, and snippets.

@tjfontaine
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjfontaine/857269b6c79b3f38e005 to your computer and use it in GitHub Desktop.
Save tjfontaine/857269b6c79b3f38e005 to your computer and use it in GitHub Desktop.
global sreqs = 0
global creqs = 0
function report() {
printf("sreqs: %d -- creqs: %d\n", sreqs, creqs);
}
probe timer.s(1) {
report()
}
probe http__server__request {
sreqs += 1
}
probe http__server__response {
if (sreqs > 0)
sreqs -= 1
}
probe http__client__request {
creqs += 1
}
probe http__client__response {
if (creqs > 0)
creqs -= 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment