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,
|
||||
|
||||
@@ -49,11 +49,18 @@ const columns: DataTableColumn<PerfStatsEvent>[] = [
|
||||
return formatDiff(row.start, row.traversalComplete);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'snapshotComplete',
|
||||
title: 'Snapshot time (Main thread)',
|
||||
onRender: (row: PerfStatsEvent) => {
|
||||
return formatDiff(row.traversalComplete, row.snapshotComplete);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'queuingComplete',
|
||||
title: 'Queuing time',
|
||||
onRender: (row: PerfStatsEvent) => {
|
||||
return formatDiff(row.traversalComplete, row.queuingComplete);
|
||||
return formatDiff(row.snapshotComplete, row.queuingComplete);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -164,6 +164,7 @@ function Visualization2DNode({
|
||||
top: toPx(bounds.y),
|
||||
width: toPx(bounds.width),
|
||||
height: toPx(bounds.height),
|
||||
opacity: isSelected || isHovered ? 0.5 : 1,
|
||||
backgroundColor: isSelected
|
||||
? theme.primaryColor
|
||||
: isHovered
|
||||
|
||||
@@ -26,6 +26,7 @@ export type PerfStatsEvent = {
|
||||
observerType: string;
|
||||
start: number;
|
||||
traversalComplete: number;
|
||||
snapshotComplete: number;
|
||||
serializationComplete: number;
|
||||
queuingComplete: number;
|
||||
socketComplete: number;
|
||||
|
||||
Reference in New Issue
Block a user