added metrics for snapshot
Reviewed By: lblasa Differential Revision: D39886448 fbshipit-source-id: b229f6947d199026c6e4bdc89def6ac0a0fa9d0a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4442c8599d
commit
78e84a0cc3
@@ -66,6 +66,7 @@ class NativeScanScheduler(val context: Context) : Scheduler.Task<ScanResult> {
|
||||
input.txId,
|
||||
"FullScan",
|
||||
input.scanStart,
|
||||
input.scanStart,
|
||||
input.scanEnd,
|
||||
input.scanEnd,
|
||||
serializationEnd,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user