From 4b4b6fabc03350f3580f73a295055e71804c8a83 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 14 Feb 2021 20:16:44 +0000 Subject: [PATCH] Add percentage of valid indexes, groups and keys to the table Signed-off-by: Graham --- .../main/kotlin/org/openrs2/archive/cache/CacheExporter.kt | 4 ++++ .../org/openrs2/archive/templates/caches/index.html | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt index 57de0231ea..808f173299 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt @@ -19,11 +19,15 @@ public class CacheExporter @Inject constructor( ) { public data class ArchiveStats(val indexes: Long, val validIndexes: Long) { public val allIndexesValid: Boolean = indexes == validIndexes + public val validIndexesFraction: Double = validIndexes.toDouble() / indexes } public data class GroupStats(val groups: Long, val validGroups: Long, val keys: Long, val validKeys: Long) { public val allGroupsValid: Boolean = groups == validGroups + public val validGroupsFraction: Double = validGroups.toDouble() / groups + public val allKeysValid: Boolean = keys == validKeys + public val validKeysFraction: Double = validKeys.toDouble() / keys } public data class Cache( diff --git a/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html b/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html index 0911b2fe2a..09d0311b72 100644 --- a/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html +++ b/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html @@ -38,17 +38,17 @@ Calculating... Calculating... Calculating...