Uses vis.js to visualise EC2 instance launch, terminate and stop events created by a spot fleet request over time.
git clone https://github.com/acbox/sfrhvis.git
cd sfrhvis
npm install
Now setup your AWS Shared Credentials File.
Optionally set default values for all requests in config.json
:
{
"listenPort": "8081",
"region": "eu-west-1",
"requestId": "sfr-9deaf2aa-4ba8-238c-18af-4bdf81b26e5a",
"startTimeOffset": "36",
}
The startTimeOffset
parameter specifies how many hours backwards from now you want to set the start time of the spot fleet request history API call. If you leave out the parameter from the config file and do not specify it in the query string (see below), it defaults to the current day at 00:00:00
(midnight).
Start the server:
node sfrhvis.js
If you've set a default request ID in config.json
, hit the server with no query parameters:
Otherwise change what you need:
The colour coding for instances on the timeline is as follows:
Box colour | Change type |
---|---|
Red | Terminated |
Gray | Stopped |
Green | Running through end time |
For reasons I don't yet understand, the DescribeSpotFleetRequestHistory API call is very picky about the start time. Too early or too late and you'll get no events. Tweak the startTimeOffset
parameter until you get what you need.