Skip to content

Commit 1eaf056

Browse files
authored
Revised cost calculator (#181)
* Changed default cloud costs from AWS to third-party bare metal * Default is one relay instead of two * Disk compression reduced to 50% * Toggle for amortization * Added selection of default costs * Redeployed * Updated logbook
1 parent 97e750b commit 1eaf056

File tree

7 files changed

+89
-23
lines changed

7 files changed

+89
-23
lines changed

Logbook.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
# Leios logbook
22

3+
## 2025-02-06
4+
5+
### Enhancements to online cost calculator
6+
7+
In response to queries and suggestions, the [online Leios cost calculator]() has been enhanced:
8+
9+
- Users can select costs for either hyperscale providers (like AWS, Azure, and GCP) or discount providers (Hetzner, OVH Cloud, etc.).
10+
- Costs default to that of a discount provider.
11+
- Users can optionally amortize ledger storage costs perpetually vs compute a first-month snapshot of storage costs.
12+
- Deployments default to a single relay instead of two.
13+
- The disk compression default was reduced to a conservative 50%.
14+
315
## 2025-01-31
416

5-
## Formal Methods
17+
### Formal Methods
618

719
- Finalizing executable specifications for Simplified and Short Leios
820
- Short Leios spec extracted to Haskell for conformance testing

cost-dashboard/index.html

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,29 +214,33 @@ <h2>v0.3, <small><a href="https://drive.google.com/file/d/1pH1GYRInevlKcrkpFRJYI
214214
<td>GB</td>
215215
</tr>
216216
<tr>
217-
<th rowspan="5">Costs</th>
217+
<th rowspan="5">Costs<br/>
218+
<br/><input type="button" value="hyperscale provider" onclick="Controller.hyperscaleCosts()"/> <span title="Set costs to values typical of the largest cloud providers"></span>
219+
<br/><input type="button" value="discount provider" onclick="Controller.discountCosts()"/> <span title="Set costs to values typical of a discount cloud provider"></span>
220+
</th>
218221
<th colspan="2">vCPU <span title="Monthly cost of a virtual CPU."></span></th>
219222
<td><input id="uiVcpu" type="number" min="0" max="100" value="20" step="0.01"/></td>
220223
<td>USD/vCPU/month</td>
221224
</tr>
222225
<tr>
223226
<th colspan="2">Storage <span title="Monthly cost of cloud disk attached to a virtual machine."></span></th>
224-
<td><input id="uiStorage" type="number" min="0" max="1" value="0.12" step="0.01"/></td>
227+
<td><input id="uiStorage" type="number" min="0" max="1" value="0.10" step="0.01"/></td>
225228
<td>USD/GB/month</td>
226229
</tr>
227230
<tr>
228231
<th colspan="2">IOPS <span title="Monthly cost of cloud input/output operation capacity."></span></th>
229-
<td><input id="uiIops" type="number" min="0" max="0.5" value="0.05" step="0.001"/></td>
232+
<td><input id="uiIops" type="number" min="0" max="0.5" value="0.00" step="0.001"/></td>
230233
<td>USD/(IO/s)/month</td>
231234
</tr>
232235
<tr>
233236
<th colspan="2">Network egress <span title="Monthly cost of cloud network egress."></span></th>
234-
<td><input id="uiEgress" type="number" min="0" max="1" value="0.10" step="0.01"/></td>
237+
<td><input id="uiEgress" type="number" min="0" max="1" value="0.00" step="0.01"/></td>
235238
<td>USD/GB</td>
236239
</tr>
237240
<tr>
238-
<th colspan="2">Discount rate <span title="Annual rate at which cloud-computing costs decrease."></span></th>
239-
<td><input id="uiDiscount" type="number" min="0" max="50" value="15" step="0.1"/></td>
241+
<th colspan="1">Discount rate <span title="Annual rate at which cloud-computing costs decrease."></span></th>
242+
<th>Amortize? <span title="Whether to compute perpetual storage cost."></span><input id="uiAmortize" type="checkbox"/></th>
243+
<td><input id="uiDiscount" type="number" min="0" max="50" value="15" step="0.1" disabled="true"/></td>
240244
<td>%/year</td>
241245
</tr>
242246
<tr>
@@ -247,7 +251,7 @@ <h2>v0.3, <small><a href="https://drive.google.com/file/d/1pH1GYRInevlKcrkpFRJYI
247251
</tr>
248252
<tr>
249253
<th colspan="2">Relays <span title="Number of relay nodes operated by the stake pool."></span></th>
250-
<td><input id="uiRelays" type="number" min="0" max="10" value="2" step="1"/></td>
254+
<td><input id="uiRelays" type="number" min="0" max="10" value="1" step="1"/></td>
251255
<td>nodes</td>
252256
</tr>
253257
<tr>
@@ -294,7 +298,7 @@ <h2>v0.3, <small><a href="https://drive.google.com/file/d/1pH1GYRInevlKcrkpFRJYI
294298
</tr>
295299
<tr>
296300
<th colspan="2">Storage compression <span title="Percentage by which each node's disk storage space is reduced by using data compression or a compressed file system."></span></th>
297-
<td><input id="uiCompression" type="number" min="0" max="100" value="75" step="0.1"/></td>
301+
<td><input id="uiCompression" type="number" min="0" max="100" value="50" step="0.1"/></td>
298302
<td>%</td>
299303
</tr>
300304
<tr>
@@ -344,7 +348,7 @@ <h2>v0.3, <small><a href="https://drive.google.com/file/d/1pH1GYRInevlKcrkpFRJYI
344348
<td>USD/month</td>
345349
</tr>
346350
<tr>
347-
<th>Disk (amortized) <span title="The stake pool's monthly cost of perpetually storing the month's transactions on disk."></span></th>
351+
<th>Disk <span id="uiAmortized">(amortized)</span> <span title="The stake pool's monthly cost of perpetually storing the month's transactions on disk."></span></th>
348352
<td id="uiCostStorage">?</td>
349353
<td>USD/month</td>
350354
</tr>

cost-dashboard/src/controller.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ export async function calculate() {
142142
const costVcpu = vcpu * getFloat(uiVcpu)
143143
uiCostVcpu.innerText = costVcpu.toFixed(2)
144144

145+
uiAmortized.style.textDecoration = uiAmortize.checked ? "none" : "line-through"
145146
const discount = getFloat(uiDiscount) / 100 / 12 // 1/month
146-
const perpetual = (1 + discount) / discount // 1
147+
const perpetual = uiAmortize.checked ? (1 + discount) / discount : 1 // 1
147148
const compression = 1 - getFloat(uiCompression) / 100 // 1
148149
const storage = nodes * compression * (getFloat(uiRbLedger) + resources.disk / gigabyte * month) // GB/month
149150
uiTotalStorage.innerText = storage.toFixed(2)
@@ -186,9 +187,26 @@ export async function calculate() {
186187

187188
}
188189

190+
export async function hyperscaleCosts() {
191+
uiVcpu.value = "20"
192+
uiStorage.value = "0.12"
193+
uiIops.value = "0.05"
194+
uiEgress.value = "0.09"
195+
calculate()
196+
}
197+
198+
export async function discountCosts() {
199+
uiVcpu.value = "20"
200+
uiStorage.value = "0.10"
201+
uiIops.value = "0.00"
202+
uiEgress.value = "0.00"
203+
calculate()
204+
}
205+
189206
export async function initialize() {
190207
[
191208
uiAda
209+
, uiAmortize
192210
, uiCertBuild
193211
, uiCertIo
194212
, uiCertRate

cost-dashboard/view.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,26 @@
3838
text-align: left;
3939
}
4040

41-
input {
41+
#uiAmortized {
42+
text-decoration: line-through;
43+
}
44+
45+
input[type="text"] {
4246
width: 75px;
4347
text-align: right;
4448
font-family: monospace;
4549
}
4650

51+
input[type="number"] {
52+
width: 75px;
53+
text-align: right;
54+
font-family: monospace;
55+
}
56+
57+
input[type="button"] {
58+
width: 75%;
59+
}
60+
4761
table {
4862
width: fit-content;
4963
border-collapse: collapse;

site/static/cost-estimator/controller.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/static/cost-estimator/index.html

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,29 +214,33 @@ <h2>v0.3, <small><a href="https://drive.google.com/file/d/1pH1GYRInevlKcrkpFRJYI
214214
<td>GB</td>
215215
</tr>
216216
<tr>
217-
<th rowspan="5">Costs</th>
217+
<th rowspan="5">Costs<br/>
218+
<br/><input type="button" value="hyperscale provider" onclick="Controller.hyperscaleCosts()"/> <span title="Set costs to values typical of the largest cloud providers"></span>
219+
<br/><input type="button" value="discount provider" onclick="Controller.discountCosts()"/> <span title="Set costs to values typical of a discount cloud provider"></span>
220+
</th>
218221
<th colspan="2">vCPU <span title="Monthly cost of a virtual CPU."></span></th>
219222
<td><input id="uiVcpu" type="number" min="0" max="100" value="20" step="0.01"/></td>
220223
<td>USD/vCPU/month</td>
221224
</tr>
222225
<tr>
223226
<th colspan="2">Storage <span title="Monthly cost of cloud disk attached to a virtual machine."></span></th>
224-
<td><input id="uiStorage" type="number" min="0" max="1" value="0.12" step="0.01"/></td>
227+
<td><input id="uiStorage" type="number" min="0" max="1" value="0.10" step="0.01"/></td>
225228
<td>USD/GB/month</td>
226229
</tr>
227230
<tr>
228231
<th colspan="2">IOPS <span title="Monthly cost of cloud input/output operation capacity."></span></th>
229-
<td><input id="uiIops" type="number" min="0" max="0.5" value="0.05" step="0.001"/></td>
232+
<td><input id="uiIops" type="number" min="0" max="0.5" value="0.00" step="0.001"/></td>
230233
<td>USD/(IO/s)/month</td>
231234
</tr>
232235
<tr>
233236
<th colspan="2">Network egress <span title="Monthly cost of cloud network egress."></span></th>
234-
<td><input id="uiEgress" type="number" min="0" max="1" value="0.10" step="0.01"/></td>
237+
<td><input id="uiEgress" type="number" min="0" max="1" value="0.00" step="0.01"/></td>
235238
<td>USD/GB</td>
236239
</tr>
237240
<tr>
238-
<th colspan="2">Discount rate <span title="Annual rate at which cloud-computing costs decrease."></span></th>
239-
<td><input id="uiDiscount" type="number" min="0" max="50" value="15" step="0.1"/></td>
241+
<th colspan="1">Discount rate <span title="Annual rate at which cloud-computing costs decrease."></span></th>
242+
<th>Amortize? <span title="Whether to compute perpetual storage cost."></span><input id="uiAmortize" type="checkbox"/></th>
243+
<td><input id="uiDiscount" type="number" min="0" max="50" value="15" step="0.1" disabled="true"/></td>
240244
<td>%/year</td>
241245
</tr>
242246
<tr>
@@ -247,7 +251,7 @@ <h2>v0.3, <small><a href="https://drive.google.com/file/d/1pH1GYRInevlKcrkpFRJYI
247251
</tr>
248252
<tr>
249253
<th colspan="2">Relays <span title="Number of relay nodes operated by the stake pool."></span></th>
250-
<td><input id="uiRelays" type="number" min="0" max="10" value="2" step="1"/></td>
254+
<td><input id="uiRelays" type="number" min="0" max="10" value="1" step="1"/></td>
251255
<td>nodes</td>
252256
</tr>
253257
<tr>
@@ -294,7 +298,7 @@ <h2>v0.3, <small><a href="https://drive.google.com/file/d/1pH1GYRInevlKcrkpFRJYI
294298
</tr>
295299
<tr>
296300
<th colspan="2">Storage compression <span title="Percentage by which each node's disk storage space is reduced by using data compression or a compressed file system."></span></th>
297-
<td><input id="uiCompression" type="number" min="0" max="100" value="75" step="0.1"/></td>
301+
<td><input id="uiCompression" type="number" min="0" max="100" value="50" step="0.1"/></td>
298302
<td>%</td>
299303
</tr>
300304
<tr>
@@ -344,7 +348,7 @@ <h2>v0.3, <small><a href="https://drive.google.com/file/d/1pH1GYRInevlKcrkpFRJYI
344348
<td>USD/month</td>
345349
</tr>
346350
<tr>
347-
<th>Disk (amortized) <span title="The stake pool's monthly cost of perpetually storing the month's transactions on disk."></span></th>
351+
<th>Disk <span id="uiAmortized">(amortized)</span> <span title="The stake pool's monthly cost of perpetually storing the month's transactions on disk."></span></th>
348352
<td id="uiCostStorage">?</td>
349353
<td>USD/month</td>
350354
</tr>

site/static/cost-estimator/view.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,26 @@
3838
text-align: left;
3939
}
4040

41-
input {
41+
#uiAmortized {
42+
text-decoration: line-through;
43+
}
44+
45+
input[type="text"] {
4246
width: 75px;
4347
text-align: right;
4448
font-family: monospace;
4549
}
4650

51+
input[type="number"] {
52+
width: 75px;
53+
text-align: right;
54+
font-family: monospace;
55+
}
56+
57+
input[type="button"] {
58+
width: 75%;
59+
}
60+
4761
table {
4862
width: fit-content;
4963
border-collapse: collapse;

0 commit comments

Comments
 (0)