Refactoring

This commit is contained in:
Martin Beyer
2020-07-21 15:16:53 +02:00
parent 158677bd54
commit 00dd67e345
4 changed files with 15 additions and 16 deletions

View File

@@ -64,17 +64,17 @@ public class VaultStats {
private void updateStats(Optional<CryptoFileSystemStats> stats) {
assert Platform.isFxApplicationThread();
bytesPerSecondRead.set(stats.map(CryptoFileSystemStats::pollBytesRead).orElse(0l));
bytesPerSecondWritten.set(stats.map(CryptoFileSystemStats::pollBytesWritten).orElse(0l));
bytesPerSecondRead.set(stats.map(CryptoFileSystemStats::pollBytesRead).orElse(0L));
bytesPerSecondWritten.set(stats.map(CryptoFileSystemStats::pollBytesWritten).orElse(0L));
cacheHitRate.set(stats.map(this::getCacheHitRate).orElse(0.0));
bytesPerSecondDecrypted.set(stats.map(CryptoFileSystemStats::pollBytesDecrypted).orElse(0l));
bytesPerSecondEncrypted.set(stats.map(CryptoFileSystemStats::pollBytesEncrypted).orElse(0l));
toalBytesRead.set(stats.map(CryptoFileSystemStats::pollTotalBytesRead).orElse(0l));
toalBytesWritten.set(stats.map(CryptoFileSystemStats::pollTotalBytesWritten).orElse(0l));
totalBytesEncrypted.set(stats.map(CryptoFileSystemStats::pollTotalBytesEncrypted).orElse(0l));
totalBytesDecrypted.set(stats.map(CryptoFileSystemStats::pollTotalBytesDecrypted).orElse(0l));
filesRead.set(stats.map(CryptoFileSystemStats::pollAmountOfFilesRead).orElse(0l));
filesWritten.set(stats.map(CryptoFileSystemStats::pollAmountOfFilesWritten).orElse(0l));
bytesPerSecondDecrypted.set(stats.map(CryptoFileSystemStats::pollBytesDecrypted).orElse(0L));
bytesPerSecondEncrypted.set(stats.map(CryptoFileSystemStats::pollBytesEncrypted).orElse(0L));
toalBytesRead.set(stats.map(CryptoFileSystemStats::pollTotalBytesRead).orElse(0L));
toalBytesWritten.set(stats.map(CryptoFileSystemStats::pollTotalBytesWritten).orElse(0L));
totalBytesEncrypted.set(stats.map(CryptoFileSystemStats::pollTotalBytesEncrypted).orElse(0L));
totalBytesDecrypted.set(stats.map(CryptoFileSystemStats::pollTotalBytesDecrypted).orElse(0L));
filesRead.set(stats.map(CryptoFileSystemStats::pollAmountOfAccessesRead).orElse(0L));
filesWritten.set(stats.map(CryptoFileSystemStats::pollAmountOfAccessesWritten).orElse(0L));
}

View File

@@ -16,7 +16,7 @@
<HBox xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="org.cryptomator.ui.stats.VaultStatisticsController"
prefWidth="1000.0" spacing="12">
prefWidth="800.0" spacing="12">
<padding>
<Insets topRightBottomLeft="12"/>
</padding>
@@ -36,7 +36,7 @@
</VBox>
<!-- Read -->
<VBox prefWidth="400" prefHeight="200">
<VBox prefWidth="300" prefHeight="300">
<HBox spacing="12" alignment="CENTER">
<Label styleClass="label-large" text="%stats.readDataLabel"/>
<ThrougputLabel styleClass="label-large" alignment="CENTER_RIGHT" minWidth="60" idleFormat="%main.vaultDetail.throughput.idle" kibsFormat="%main.vaultDetail.throughput.kbps"
@@ -71,7 +71,7 @@
</VBox>
<!-- Write -->
<VBox prefWidth="400" prefHeight="200">
<VBox prefWidth="300" prefHeight="300">
<HBox alignment="CENTER">
<Label styleClass="label-large" text="%stats.writtenDataLabel"/>
<ThrougputLabel styleClass="label-large" alignment="CENTER_RIGHT" minWidth="60" idleFormat="%main.vaultDetail.throughput.idle" kibsFormat="%main.vaultDetail.throughput.kbps"

View File

@@ -5,7 +5,6 @@
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?>
<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
<?import org.cryptomator.ui.controls.ThrougputLabel?>
<VBox xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="org.cryptomator.ui.mainwindow.VaultDetailUnlockedController"

View File

@@ -169,8 +169,8 @@ stats.totalMiBRead=Total Read:
stats.totalMiBWritten=Total Written:
stats.totalMiBEncrypted=Total Encypted:
stats.totalMiBDecrypted=Total Decrypted:
stats.totalReads=%s Files Read
stats.totalWrites=%s Files Written
stats.totalReads=%s Number of Reads
stats.totalWrites=%s Number of Writes
stats.data.bytes=%s Bytes
stats.data.kiB=%.1f KiB
stats.data.miB=%.1f MiB