Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Add actual cost in `Normalized instance hours` column
- *
- * Q: How do you calculate the Normalized Instance Hours displayed on the
- * console ?
- *
- * On the AWS Management Console, every cluster has a Normalized Instance Hours
- * column that displays the approximate number of compute hours the cluster has
- * used. Normalized Instance Hours are hours of compute time based on the
- * standard of 1 hour of m1.small usage = 1 hour normalized compute time.
- *
- * As of 2016-10-20, m1.small costs $0.044/hr
- */
- function addNormalizedInstanceHoursCost() {
- var tbody = $('.GF2SJOLOO');
- // console.log(tbody);
- if (! tbody) {
- console.log("Didn't find tbody w/ class `GF2SJOLOO`");
- return;
- }
- var trs = tbody.find('tr');
- if (! trs) {
- console.log("Didn't find tbody trs");
- return;
- }
- console.log("Adding normalized instance hours costs for " + trs.length + " clusters ...");
- $.each(trs, function(index, tr) {
- var td = $(this).find('td').last();
- var hours = td.text();
- var cost = (0.044 * hours).toFixed(2);
- var tdStr = hours + " ($" + cost + ")";
- td.text(tdStr);
- })
- }
- function main() {
- console.log("Running `~/.js/console.aws.amazon.com.js ...");
- // These things load asynchronously, so wait a few ticks before kicking it off
- window.setTimeout(addNormalizedInstanceHoursCost, 3000);
- }
- main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement