Skip to content

Instantly share code, notes, and snippets.

@dcabines
Created November 18, 2012 00:59
Show Gist options
  • Save dcabines/4102253 to your computer and use it in GitHub Desktop.
Save dcabines/4102253 to your computer and use it in GitHub Desktop.
Prices of Cloud Storage Line Chart. Paste it into the Google Code Playground. See an example at http://i.imgur.com/p7QqV.png
// Amazon Glacier has a 3 to 5 hour access time.
// Glacier Archive and Restore Requests are $0.05 per 1,000 requests
// Glacier is designed with the expectation that restores are infrequent and unusual, and data will be stored for extended periods of time.
// You can restore up to 5% of your average monthly Glacier storage (pro-rated daily) for free each month.
// If you choose to restore more than this amount of data in a month, you are charged a restore fee starting at $0.01 per gigabyte.
// Amazon charges 0.01 per 1,000 requests (10,000 for GET requests).
// Azure charges 0.01 per 100,000 transactions.
// To make the Azure and Amazon lines not overlap, I added one one hundredth of a penny to the Amazon prices.
// Prices are lower when you buy more than a terabyte from Amazon or Azure
// Dropbox has monthly plans. This chart shows the yearly plans which are 17% cheaper.
// GoDaddy has multi year plans that save up to 30%. This chart shows the one year plan.
function drawVisualization() {
var prices = {
rackspace:0.1 * 12,
azureGeo:0.125 * 12,
azureLocal:0.093 * 12,
amazonStandard:0.126 * 12,
amazonReduced:0.094 * 12,
amazonGlacier:0.010 * 12,
dropbox:0,
google:0,
skydrive:0,
godaddy:23.88
};
var data = [];
data[0] = [
'x',
'Amazon Standard',
'Rackspace',
'Amazon Reduced',
'Azure Geo',
'Dropbox',
'Google Drive',
'SkyDrive',
'GoDaddy',
'Amazon Glacier',
'Azure Local'
];
var maxGigs = 700;
for (var gigs=1; gigs<=maxGigs; gigs++) {
// godaddy
var basePlan = 2.49 * 12;
if(gigs > 10) prices.godaddy = 1.99 * 12;
if(gigs > 100) prices.godaddy = basePlan + 6.99;
if(gigs > 105) prices.godaddy = basePlan + 13.98;
if(gigs > 110) prices.godaddy = basePlan + 27.96;
if(gigs > 120) prices.godaddy = basePlan + 41.94;
if(gigs > 130) prices.godaddy = basePlan + 69.90;
if(gigs > 150) prices.godaddy = basePlan + 139.80;
if(gigs > 200) prices.godaddy = 0; // No plans beyond 200GB.
// dropbox
if(gigs > 2) prices.dropbox = 99;
if(gigs > 100) prices.dropbox = 199;
if(gigs > 200) prices.dropbox = 499;
if(gigs > 500) prices.dropbox = 0; // No plans beyond 500GB.
//google
if(gigs > 5) prices.google = 2.49 * 12;
if(gigs > 25) prices.google = 4.99 * 12;
if(gigs > 100) prices.google = 9.99 * 12;
if(gigs > 200) prices.google = 19.99 * 12;
if(gigs > 400) prices.google = 49.99 * 12;
// Up to 16 TB available
// skydrive
if(gigs > 7) prices.skydrive = 10;
if(gigs > 20) prices.skydrive = 25;
if(gigs > 50) prices.skydrive = 50;
if(gigs > 100) prices.skydrive = 0; // No plans beyond 100GB.
data[gigs] = [
gigs,
prices.amazonStandard * gigs,
prices.rackspace * gigs,
prices.amazonReduced * gigs,
prices.azureGeo * gigs,
prices.dropbox,
prices.google,
prices.skydrive,
prices.godaddy,
prices.amazonGlacier * gigs,
prices.azureLocal * gigs
];
}
console.log(data);
// Create and populate the data table.
var table = google.visualization.arrayToDataTable(data);
var tableOptions = {
width: 1000,
height: 1000,
colors:[
'#14A819',
'#22A2A8',
'#43A847',
'#2279A8',
'#8D22A8',
'#A82253',
'#2822A8',
'#A85522',
'#65A867',
'#6591A8'
]
};
// Create and draw the visualization.
var chart = new google.visualization.LineChart(document.getElementById('visualization'));
chart.draw(table, tableOptions);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment