added metrics for snapshot

Reviewed By: lblasa

Differential Revision: D39886448

fbshipit-source-id: b229f6947d199026c6e4bdc89def6ac0a0fa9d0a
This commit is contained in:
Luke De Feo
2022-09-29 05:31:18 -07:00
committed by Facebook GitHub Bot
parent 4442c8599d
commit 78e84a0cc3
7 changed files with 25 additions and 3 deletions

View File

@@ -66,6 +66,7 @@ class NativeScanScheduler(val context: Context) : Scheduler.Task<ScanResult> {
input.txId,
"FullScan",
input.scanStart,
input.scanStart,
input.scanEnd,
input.scanEnd,
serializationEnd,

View File

@@ -43,6 +43,7 @@ data class PerfStatsEvent(
val observerType: String,
val start: Long,
val traversalComplete: Long,
val snapshotComplete: Long,
val queuingComplete: Long,
val serializationComplete: Long,
val socketComplete: Long,

View File

@@ -81,6 +81,8 @@ abstract class TreeObserver<T> {
Log.d(LogTag, "For Observer ${this.type} Sending ${visitedNodes.size}")
val traversalCompleteTime = System.currentTimeMillis()
if (snapshotBitmap != null) {
@Suppress("unchecked_cast")
val descriptor =
@@ -89,10 +91,17 @@ abstract class TreeObserver<T> {
descriptor.getSnapshot(root, snapshotBitmap.bitmap)
}
val endTimestamp = System.currentTimeMillis()
val snapshotCompleteTime = System.currentTimeMillis()
context.treeObserverManager.enqueueUpdate(
SubtreeUpdate(
type, root.nodeId(), visitedNodes, startTimestamp, endTimestamp, snapshotBitmap))
type,
root.nodeId(),
visitedNodes,
startTimestamp,
traversalCompleteTime,
snapshotCompleteTime,
snapshotBitmap))
}
fun cleanUpRecursive() {

View File

@@ -31,6 +31,7 @@ data class SubtreeUpdate(
val nodes: List<Node>,
val startTime: Long,
val traversalCompleteTime: Long,
val snapshotComplete: Long,
val snapshot: BitmapPool.ReusableBitmap?
)
@@ -104,6 +105,7 @@ class TreeObserverManager(val context: Context) {
observerType = treeUpdate.observerType,
start = treeUpdate.startTime,
traversalComplete = treeUpdate.traversalCompleteTime,
snapshotComplete = treeUpdate.snapshotComplete,
queuingComplete = onWorkerThread,
serializationComplete = serializationEnd,
socketComplete = socketEnd,