Closed kellyi closed 7 years ago
A general note, it's a little unfortunate that the script is written in node, since the worker machine that runs this service doesn't have that runtime installed. That'll make it slightly challenging to run this on an instance built off of a CI built AMI, or even in our dev VM setup - even if it works fine on your dev host. The benchmarking will be most meaningful on instances resembling our production infrastructure, due to the compute configuration but mostly due to the network available.
I don't think it's problematic enough it to rewrite, but it's a good practice to keep these utility scripts in bash or python, which is both consistent with our other scripts and likely to be available on most of our setups without augmentation.
it's a little unfortunate that the script is written in node, since the worker machine that runs this service doesn't have that runtime installed
Good point. There was another issue I encountered while trying to use Node which was that the requests were asynchronous and getting them to complete in the correct order required lacing Promises throughout the script in a way that didn't seem like it'd be very easy to maintain.
To simplify things, 269be61 replaces the Node.js version with a simpler Python script. Going to write a proper PR message with testing instructions now.
Thanks for taking a look at this!
Overview
This PR adds a
benchmark
script along with some sample input data to the project. I originally tried writing this in Node but for a few reasons noted in the comments below it turned out not to be a great candidate for this. I ultimately used Python instead.This includes a dependency on the
requests
library which is installed on the Worker VM and can be installed locally usingeasy_install requests
. If it's not available, the script exits immediately with a note that it's required.Connects #66
Demo
Here's the output from running the script for all included operations:
Notes
I used the built in
ArgumentParser
library for the command line options. Running./scripts/benchmark
with no options given will run all the timing jobs; running it with--help
will print a usage string. You can also run it with--huc8 --huc12 --huc10 --rga
and it will execute whichever of the jobs you're provided as arguments.If it's not available globally, you'll need to
sudo easy_install requests
.Testing
./scripts/server
./scripts/benchmark --help
and verify that you see the usage string./scripts/benchmark
with no options and verify that all the timing jobs run--huc8 --huc12 --huc10 --rga
and verify that it executes the jobs you've specified.