Stats printing
This commit is contained in:
@@ -12,6 +12,22 @@ class TransactionLog(
|
||||
fileManager.findLastSnapshot().let { (after, snapshot) ->
|
||||
println("Last snapshot: $snapshot")
|
||||
|
||||
println("Snapshot:")
|
||||
snapshot?.inputStream()?.use { input ->
|
||||
ObjectInputStream(input).use { ois ->
|
||||
val versionNumber = ois.readInt()
|
||||
check(versionNumber == 1) { "Unsupported version number: $versionNumber" }
|
||||
val transactionNumber = ois.readLong()
|
||||
println("[$versionNumber] $transactionNumber")
|
||||
val data = ois.readObject() as MutableMap<Class<*>, TypeData>
|
||||
println("Data:")
|
||||
println("\tClasses:")
|
||||
for ((cls, entries) in data.entries) {
|
||||
println("\t\t- $cls: ${entries.data.keys.size}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val transactions = fileManager.findTransactionsAfter(after ?: 0L)
|
||||
|
||||
println("Transactions:")
|
||||
@@ -22,7 +38,10 @@ class TransactionLog(
|
||||
check(versionNumber == 1) { "Unsupported version number: $versionNumber" }
|
||||
val transactionNumber = ois.readLong()
|
||||
val actions = ois.readObject() as Set<Action>
|
||||
println("[$versionNumber] $transactionNumber - ${actions.joinToString(",")}")
|
||||
println("\t[$transactionNumber]")
|
||||
for (action in actions) {
|
||||
println("\t\t- $action")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user