mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-04 13:29:13 -04:00
added space efficiency info
This commit is contained in:
parent
b476b6808e
commit
cb23cdf343
2 changed files with 33 additions and 1 deletions
|
@ -11,6 +11,10 @@ const raidCalculations = {
|
|||
// total disks * size
|
||||
return (num * size) * unit;
|
||||
},
|
||||
efficiency(num) {
|
||||
// uses 100% of space
|
||||
return 100;
|
||||
},
|
||||
fault(num, size, unit) {
|
||||
return 'None';
|
||||
},
|
||||
|
@ -25,6 +29,10 @@ const raidCalculations = {
|
|||
// total size is size of a single drive
|
||||
return size * unit;
|
||||
},
|
||||
efficiency(num) {
|
||||
// 1/N
|
||||
return (1 / num) * 100;
|
||||
},
|
||||
fault(num, size, unit) {
|
||||
// FT = total - 1
|
||||
return `${num - 1} drive failures`;
|
||||
|
@ -40,6 +48,10 @@ const raidCalculations = {
|
|||
// (N-1) * S (one drive for parity)
|
||||
return ((num - 1) * size) * unit;
|
||||
},
|
||||
efficiency(num) {
|
||||
// 1 - (1/N)
|
||||
return (1 - (1 / num)) * 100;
|
||||
},
|
||||
fault(num, size, unit) {
|
||||
// always 1 failure
|
||||
return '1 drive failure';
|
||||
|
@ -55,6 +67,10 @@ const raidCalculations = {
|
|||
// (N-2) * S (2 parity)
|
||||
return ((num - 2) * size) * unit;
|
||||
},
|
||||
efficiency(num) {
|
||||
// 1 - (2/N)
|
||||
return (1 - (2 / num)) * 100;
|
||||
},
|
||||
fault(num, size, unit) {
|
||||
// always 2 drive failures
|
||||
return '2 drive failures';
|
||||
|
@ -70,6 +86,10 @@ const raidCalculations = {
|
|||
// Total disks (stripe)/2 (mirror)
|
||||
return ((num * size) / 2) * unit;
|
||||
},
|
||||
efficiency(num) {
|
||||
// 1/2 (1/strips per stripe, 2 in this case)
|
||||
return 50;
|
||||
},
|
||||
fault(num, size, unit) {
|
||||
// one per mirror
|
||||
return '1 drive failure per mirrored set';
|
||||
|
|
|
@ -28,6 +28,10 @@ const calculatedFaultTolerance = computed(() => {
|
|||
return raidCalculations[raidType.value].fault(diskTotal.value, diskSize.value, diskUnit.value);
|
||||
});
|
||||
|
||||
const calculatedSpaceEfficiency = computed(() => {
|
||||
return raidCalculations[raidType.value].efficiency(diskTotal.value);
|
||||
});
|
||||
|
||||
function validateSetup() {
|
||||
// validate the selected RAID type against parameters
|
||||
return raidCalculations[raidType.value].validate(diskTotal.value, diskSize.value);
|
||||
|
@ -90,10 +94,18 @@ function validateSetup() {
|
|||
<td font-bold width="30%">
|
||||
Fault Tolerance
|
||||
</td>
|
||||
<td :value="calculatedFaultTolerance">
|
||||
<td>
|
||||
{{ calculatedFaultTolerance }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td font-bold width="30%">
|
||||
Space Efficiency
|
||||
</td>
|
||||
<td>
|
||||
{{ calculatedSpaceEfficiency }}%
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
</c-card>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue