Skip to content

Instantly share code, notes, and snippets.

@dlai0001
Created July 1, 2016 18:27
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 dlai0001/3a2ccbbb8ebd7b916630acb7907c734a to your computer and use it in GitHub Desktop.
Save dlai0001/3a2ccbbb8ebd7b916630acb7907c734a to your computer and use it in GitHub Desktop.
Monitor peak requests per second and average rps in locust.io
ax_peak = 0;
ax_avg = 0;
ax_count = 0;
setInterval(function() {
rps = parseFloat($("#total_rps").text())
ax_avg = (ax_avg * ax_count + rps) / (++ax_count);
if(rps > ax_peak) {
ax_peak = rps;
console.log("peak requests:" + ax_peak);
}
}, 50);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment