diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/VaultStats.java b/main/commons/src/main/java/org/cryptomator/common/vaults/VaultStats.java index fcb3b5cce..7b83a8a8c 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/VaultStats.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/VaultStats.java @@ -37,8 +37,8 @@ public class VaultStats { private final LongProperty toalBytesWritten = new SimpleLongProperty(); private final LongProperty totalBytesEncrypted = new SimpleLongProperty(); private final LongProperty totalBytesDecrypted = new SimpleLongProperty(); - //private final IntegerProperty filesRead = new SimpleIntegerProperty(); - //private final IntegerProperty filesWritten = new SimpleIntegerProperty(); + private final LongProperty filesRead = new SimpleLongProperty(); + private final LongProperty filesWritten = new SimpleLongProperty(); @Inject VaultStats(AtomicReference fs, ObjectProperty state, ExecutorService executor) { @@ -69,10 +69,12 @@ public class VaultStats { 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::pollBytesRead).orElse(0l) + toalBytesRead.get()); - toalBytesWritten.set(stats.map(CryptoFileSystemStats::pollBytesWritten).orElse(0l) + toalBytesWritten.get()); - totalBytesEncrypted.set(stats.map(CryptoFileSystemStats::pollBytesEncrypted).orElse(0l) + totalBytesEncrypted.get()); - totalBytesDecrypted.set(stats.map(CryptoFileSystemStats::pollBytesDecrypted).orElse(0l) + totalBytesDecrypted.get()); + 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)); } @@ -140,9 +142,7 @@ public class VaultStats { return bytesPerSecondDecrypted.get(); } - public DoubleProperty cacheHitRateProperty() { - return cacheHitRate; - } + public DoubleProperty cacheHitRateProperty() { return cacheHitRate; } public double getCacheHitRate() { return cacheHitRate.get(); @@ -164,5 +164,11 @@ public class VaultStats { public long getTotalBytesDecrypted() { return totalBytesDecrypted.get();} + public LongProperty filesRead() { return filesRead;} + public long getFilesRead() { return filesRead.get();} + + public LongProperty filesWritten() {return filesWritten;} + + public long getFilesWritten() {return filesWritten.get();} } diff --git a/main/ui/src/main/java/org/cryptomator/ui/stats/VaultStatisticsController.java b/main/ui/src/main/java/org/cryptomator/ui/stats/VaultStatisticsController.java index 20218d100..9397c2686 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/stats/VaultStatisticsController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/stats/VaultStatisticsController.java @@ -43,8 +43,8 @@ public class VaultStatisticsController implements FxController { private final LongBinding totalBytesWritten; private final LongBinding totalBytesEncrypted; private final LongBinding totalBytesDecrypted; - /*private final IntegerBinding filesRead; - private final IntegerBinding filesWritten;*/ + private final LongBinding filesRead; + private final LongBinding filesWritten; private final LongBinding bpsEncrypted; private final LongBinding bpsDecrypted; @@ -69,8 +69,8 @@ public class VaultStatisticsController implements FxController { this.totalBytesWritten = WeakBindings.bindLong(stats.toalBytesWrittenProperty()); this.totalBytesDecrypted = WeakBindings.bindLong(stats.totalBytesDecryptedProperty()); this.totalBytesEncrypted = WeakBindings.bindLong(stats.totalBytesEncryptedProperty()); - /*this.filesRead = WeakBindings.bindInterger(); - this.filesWritten = WeakBindings.bindInterger();*/ + this.filesRead = WeakBindings.bindLong(stats.filesRead()); + this.filesWritten = WeakBindings.bindLong(stats.filesWritten()); this.bpsEncrypted = WeakBindings.bindLong(stats.bytesPerSecondEncryptedProperty()); this.bpsDecrypted = WeakBindings.bindLong(stats.bytesPerSecondDecryptedProperty()); @@ -202,4 +202,12 @@ public class VaultStatisticsController implements FxController { public long getBpsDecrypted() { return bpsDecrypted.get(); } + + public LongBinding filesReadProperty() { return filesRead;} + + public long getFilesRead() { return filesRead.get();} + + public LongBinding filesWrittenProperty() {return filesWritten;} + + public long getFilesWritten() {return filesWritten.get();} } diff --git a/main/ui/src/main/resources/fxml/stats.fxml b/main/ui/src/main/resources/fxml/stats.fxml index dfeca90af..75482e2ab 100644 --- a/main/ui/src/main/resources/fxml/stats.fxml +++ b/main/ui/src/main/resources/fxml/stats.fxml @@ -61,15 +61,13 @@ + - + @@ -101,6 +99,8 @@ + + diff --git a/main/ui/src/main/resources/i18n/strings.properties b/main/ui/src/main/resources/i18n/strings.properties index 3e30c16fb..4a03ffb21 100644 --- a/main/ui/src/main/resources/i18n/strings.properties +++ b/main/ui/src/main/resources/i18n/strings.properties @@ -169,8 +169,8 @@ stats.totalMiBRead=Total Read: stats.totalMiBWritten=Total Written: stats.totalMiBEncrypted=Total Encypted: stats.totalMiBDecrypted=Total Decrypted: -stats.totalReads=Number of Reads: %s -stats.totalWrites=Number of Writes: %s +stats.totalReads=%s Files Read +stats.totalWrites=%s Files Written stats.data.bytes=%s Bytes stats.data.kiB=%.1f KiB stats.data.miB=%.1f MiB