Skip to content

Commit

Permalink
add DAX
Browse files Browse the repository at this point in the history
  • Loading branch information
timkoopmans committed Feb 3, 2025
1 parent 73ed03c commit 3c13b63
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 25 deletions.
1 change: 0 additions & 1 deletion dist/assets/index-CTLm646y.js

This file was deleted.

1 change: 1 addition & 0 deletions dist/assets/index-DZzuerjI.js

Large diffs are not rendered by default.

57 changes: 45 additions & 12 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-dragdata@latest/dist/chartjs-plugin-dragdata.min.js"></script>
<script type="module" crossorigin src="/assets/index-CTLm646y.js"></script>
<script type="module" crossorigin src="/assets/index-DZzuerjI.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-B9xDjrZ1.css">
</head>
<body>
Expand Down Expand Up @@ -139,7 +139,7 @@
</span>
</label>
<input type="range" id="replicatedRegions" min="0" max="24" step="1" value="0">
</div>
</div>
</div>

<a href="#" id="storageLink">▼ Storage</a>
Expand All @@ -150,8 +150,8 @@
<input type="text" id="itemSizeInp" style="display: none; width: 80px; cursor: pointer;">
<span id="itemSizeDsp">1 KB</span>
<span class="info-icon">i
<span class="tooltip-text">Enter your average item size (all attributes).</span>
</span>
<span class="tooltip-text">Enter your average item size (all attributes).</span>
</span>
</label>
<input type="range" id="itemSize" min="64" max="409600" step="64" value="1024">
</div>
Expand All @@ -161,8 +161,8 @@
<input type="text" id="storageInp" style="display: none; width: 80px; cursor: pointer;">
<span id="storageDsp">512 GB</span>
<span class="info-icon">i
<span class="tooltip-text">Enter your total data storage size.</span>
</span>
<span class="tooltip-text">Enter your total data storage size.</span>
</span>
</label>
<input type="range" id="storage" min="128" max="102400" step="128" value="512">
</div>
Expand All @@ -175,24 +175,57 @@
<label for="writeTrans">Writes:
<span id="writeConsistencyDsp">Non Transactional</span>
<span class="info-icon">i
<span class="tooltip-text">Enter write operations create, update, or delete items as a non transactional percentage, or, coordinated, all-or-nothing write operations as a transactional percentage.</span>
</span>
<span class="tooltip-text">Enter write operations create, update, or delete items as a non transactional percentage, or, coordinated, all-or-nothing write operations as a transactional percentage.</span>
</span>
</label>
<input type="range" id="writeTrans" min="0" max="100" step="1" value="0">
</div>

<div class="slider-container">
<label>Reads: <span id="readConstDsp">Strongly Consistent</span>
<span class="info-icon">i
<span class="tooltip-text">Enter read operations as eventually consistent, strongly consistent and/or transactional as a percentage.</span>
</span>
<span class="tooltip-text">Enter read operations as eventually consistent, strongly consistent and/or transactional as a percentage.</span>
</span>
</label>
<input type="range" id="readConst" class="slider" min="0" max="100" value="100">
<input type="range" id="readTrans" class="slider" min="0" max="100" value="0">
</div>
</div>

<a href="#" id="daxLink">▼ Accelerator (DAX)</a>

<div id="daxParams" style="display: none;">
<div>
<label for="daxInstanceClass">Instance Class:
<select id="daxInstanceClass">
<option value="r5Large">dax.r5.large | 2vCPU 16GB RAM</option>
<option value="r5XLarge">dax.r5.xlarge | 4vCPU 32GB RAM</option>
<option value="r52XLarge">dax.r5.2xlarge | 8vCPU 64GB RAM</option>
<option value="r54XLarge">dax.r5.4xlarge | 16vCPU 128GB RAM</option>
<option value="r58XLarge">dax.r5.8xlarge | 32vCPU 256GB RAM</option>
<option value="r512XLarge">dax.r5.12xlarge | 48vCPU 384GB RAM</option>
<option value="r516XLarge">dax.r5.16xlarge | 64vCPU 512GB RAM</option>
<option value="r524XLarge">dax.r5.24xlarge | 96vCPU 768GB RAM</option>
</select>
<span class="info-icon">i
<span class="tooltip-text">Select the instance class for your workload.</span>
</span>
</label>
</div>

<div>
<label for="daxNodes">Number of Nodes:
<input type="text" id="daxNodesInp" style="display: none; width: 80px; cursor: pointer;">
<span id="daxNodesDsp">0</span>
<span class="info-icon">i
<span class="tooltip-text">Enter the number of nodes for your workload.</span>
</span>
</label>
<input type="range" id="daxNodes" min="0" max="24" step="3" value="0">
</div>
</div>
</div>

<div id="debugPanel" class="debug-panel"></div>
</body>
</html>
</html>

55 changes: 44 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
</span>
</label>
<input type="range" id="replicatedRegions" min="0" max="24" step="1" value="0">
</div>
</div>
</div>

<a href="#" id="storageLink">▼ Storage</a>
Expand All @@ -150,8 +150,8 @@
<input type="text" id="itemSizeInp" style="display: none; width: 80px; cursor: pointer;">
<span id="itemSizeDsp">1 KB</span>
<span class="info-icon">i
<span class="tooltip-text">Enter your average item size (all attributes).</span>
</span>
<span class="tooltip-text">Enter your average item size (all attributes).</span>
</span>
</label>
<input type="range" id="itemSize" min="64" max="409600" step="64" value="1024">
</div>
Expand All @@ -161,8 +161,8 @@
<input type="text" id="storageInp" style="display: none; width: 80px; cursor: pointer;">
<span id="storageDsp">512 GB</span>
<span class="info-icon">i
<span class="tooltip-text">Enter your total data storage size.</span>
</span>
<span class="tooltip-text">Enter your total data storage size.</span>
</span>
</label>
<input type="range" id="storage" min="128" max="102400" step="128" value="512">
</div>
Expand All @@ -175,24 +175,57 @@
<label for="writeTrans">Writes:
<span id="writeConsistencyDsp">Non Transactional</span>
<span class="info-icon">i
<span class="tooltip-text">Enter write operations create, update, or delete items as a non transactional percentage, or, coordinated, all-or-nothing write operations as a transactional percentage.</span>
</span>
<span class="tooltip-text">Enter write operations create, update, or delete items as a non transactional percentage, or, coordinated, all-or-nothing write operations as a transactional percentage.</span>
</span>
</label>
<input type="range" id="writeTrans" min="0" max="100" step="1" value="0">
</div>

<div class="slider-container">
<label>Reads: <span id="readConstDsp">Strongly Consistent</span>
<span class="info-icon">i
<span class="tooltip-text">Enter read operations as eventually consistent, strongly consistent and/or transactional as a percentage.</span>
</span>
<span class="tooltip-text">Enter read operations as eventually consistent, strongly consistent and/or transactional as a percentage.</span>
</span>
</label>
<input type="range" id="readConst" class="slider" min="0" max="100" value="100">
<input type="range" id="readTrans" class="slider" min="0" max="100" value="0">
</div>
</div>

<a href="#" id="daxLink">▼ Accelerator (DAX)</a>

<div id="daxParams" style="display: none;">
<div>
<label for="daxInstanceClass">Instance Class:
<select id="daxInstanceClass">
<option value="r5Large">dax.r5.large | 2vCPU 16GB RAM</option>
<option value="r5XLarge">dax.r5.xlarge | 4vCPU 32GB RAM</option>
<option value="r52XLarge">dax.r5.2xlarge | 8vCPU 64GB RAM</option>
<option value="r54XLarge">dax.r5.4xlarge | 16vCPU 128GB RAM</option>
<option value="r58XLarge">dax.r5.8xlarge | 32vCPU 256GB RAM</option>
<option value="r512XLarge">dax.r5.12xlarge | 48vCPU 384GB RAM</option>
<option value="r516XLarge">dax.r5.16xlarge | 64vCPU 512GB RAM</option>
<option value="r524XLarge">dax.r5.24xlarge | 96vCPU 768GB RAM</option>
</select>
<span class="info-icon">i
<span class="tooltip-text">Select the instance class for your workload.</span>
</span>
</label>
</div>

<div>
<label for="daxNodes">Number of Nodes:
<input type="text" id="daxNodesInp" style="display: none; width: 80px; cursor: pointer;">
<span id="daxNodesDsp">0</span>
<span class="info-icon">i
<span class="tooltip-text">Enter the number of nodes for your workload.</span>
</span>
</label>
<input type="range" id="daxNodes" min="0" max="24" step="3" value="0">
</div>
</div>
</div>

<div id="debugPanel" class="debug-panel"></div>
</body>
</html>
</html>

2 changes: 2 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ setupSliderInteraction('peakWidthDsp', 'peakWidthInp', 'peakWidth', value => val
setupSliderInteraction('itemSizeDsp', 'itemSizeInp', 'itemSize', value => value < 1024 ? `${value} B` : `${Math.floor(value / 1024)} KB`);
setupSliderInteraction('storageDsp', 'storageInp', 'storage', value => value >= 1024 ? (value / 1024).toFixed(2) + ' TB' : value + ' GB');
setupSliderInteraction('replicatedRegionsDsp', 'replicatedRegionsInp', 'replicatedRegions', value => value);
setupSliderInteraction('daxNodesDsp', 'daxNodesInp', 'daxNodes', value => value);

document.getElementById('chart').onclick = function (event) {
ourClickHandler(event);
Expand Down Expand Up @@ -174,6 +175,7 @@ document.getElementById('storageDsp').innerText = document.getElementById('stora
toggleSection('tableLink', 'tableParams', '▲ Tables', '▼ Tables');
toggleSection('storageLink', 'storageParams', '▲ Storage', '▼ Storage');
toggleSection('consistencyLink', 'consistencyParams', '▲ Consistency', '▼ Consistency');
toggleSection('daxLink', 'daxParams', '▲ Accelerator (DAX)', '▼ Accelerator (DAX)');

document.getElementById('itemSize').addEventListener('input', function (event) {
const slider = event.target;
Expand Down
15 changes: 14 additions & 1 deletion src/calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ function getReplicatedRegions() {
cfg.replicatedRegions = parseInt(document.getElementById('replicatedRegions').value);
}

function getDaxValues() {
cfg.daxNodes = parseInt(document.getElementById('daxNodes').value);
cfg.daxInstanceClass = document.getElementById('daxInstanceClass').value;
}

function getStorageValues() {
cfg.storageGB = parseInt(document.getElementById('storage').value);
cfg.itemSizeKB = parseInt(document.getElementById('itemSize').value) * (1 / 1024);
Expand Down Expand Up @@ -154,6 +159,11 @@ function calculateNetworkCosts() {
cfg.dynamoCostNetwork = cfg.totalReplicatedWritesGB * cfg.priceIntraRegPerGB;
}

function calculateDaxCosts() {
cfg.daxInstanceClassCost = cfg.daxInstanceClassCosts[cfg.daxInstanceClass];
cfg.dynamoDaxCost = cfg.daxNodes * cfg.totalHoursPerMonth * cfg.daxInstanceClassCost;
}

export function updateCosts() {
getSelectedPricingModel();
getTableClass();
Expand All @@ -162,18 +172,20 @@ export function updateCosts() {
getConsistencyValues();
getDemandValues();
getProvisionedValues();
getDaxValues();

calculateProvisionedCosts();
calculateDemandCosts();
calculateStorageCost();
calculateTotalOpsSec();
calculateNetworkCosts();
calculateDaxCosts();

cfg.dynamoCostTotal = cfg.selectedPricingModel === 'onDemand' ?
cfg.dynamoCostDemand + cfg.dynamoCostStorage :
cfg.dynamoCostProvisioned + cfg.dynamoCostStorage;

cfg.dynamoCostTotal = cfg.dynamoCostTotal + cfg.dynamoCostNetwork + cfg.dynamoCostReplication;
cfg.dynamoCostTotal = cfg.dynamoCostTotal + cfg.dynamoCostNetwork + cfg.dynamoCostReplication + cfg.dynamoDaxCost;

const scyllaResult = calculateScyllaCosts();

Expand Down Expand Up @@ -225,6 +237,7 @@ function logCosts(scyllaResult, costRatio) {
logs = logs.concat([
`dynamoCostNetwork: $${cfg.dynamoCostNetwork.toFixed(2)}`,
`dynamoCostReplication: $${cfg.dynamoCostReplication.toFixed(2)}`,
`dynamoDaxCost: $${cfg.dynamoDaxCost.toFixed(2)}`,
`dynamoCostStorage: $${cfg.dynamoCostStorage.toFixed(2)}`,
`dynamoCostTotal: $${cfg.dynamoCostTotal.toFixed(2)}`,
`scyllaCost: $${scyllaResult.scyllaCost.toFixed(2)}`,
Expand Down
11 changes: 11 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,15 @@ export const cfg = {
pricePerRWRU_IA: 0.000000780,
// Data Transfer
priceIntraRegPerGB: 0.02,
// DAX Node Costs
daxInstanceClassCosts: {
r5Large: 0.25500000,
r5XLarge: 0.50900000,
r52XLarge: 1.01700000,
r54XLarge: 2.03400000,
r58XLarge: 4.06900000,
r512XLarge: 6.11700000,
r516XLarge: 8.13700000,
r524XLarge: 12.23400000,
}
};

0 comments on commit 3c13b63

Please sign in to comment.