Report payload size
Summary: Android changes to send payload size Reviewed By: passy Differential Revision: D45121791 fbshipit-source-id: 2cdf8f7b8849bce06949d3f7db6bdc5674fe15b7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8cd2bb97bf
commit
8657bcba64
@@ -49,7 +49,8 @@ data class PerfStatsEvent(
|
|||||||
val queuingMS: Long,
|
val queuingMS: Long,
|
||||||
val deferredComputationMS: Long,
|
val deferredComputationMS: Long,
|
||||||
val serializationMS: Long,
|
val serializationMS: Long,
|
||||||
val socketMS: Long
|
val socketMS: Long,
|
||||||
|
val payloadSize: Int,
|
||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
const val name = "performanceStats"
|
const val name = "performanceStats"
|
||||||
|
|||||||
@@ -142,6 +142,10 @@ class TreeObserverManager(val context: UIDContext) {
|
|||||||
val socketEndTimestamp = System.currentTimeMillis()
|
val socketEndTimestamp = System.currentTimeMillis()
|
||||||
Log.i(LogTag, "Sent event for batched subtree update with nodes with ${nodes.size}")
|
Log.i(LogTag, "Sent event for batched subtree update with nodes with ${nodes.size}")
|
||||||
|
|
||||||
|
// Note about payload size:
|
||||||
|
// Payload size is an approximation as it assumes all characters
|
||||||
|
// are ASCII encodable, this should be true for most of the payload content.
|
||||||
|
// So, assume each character will at most occupy one byte.
|
||||||
val perfStats =
|
val perfStats =
|
||||||
PerfStatsEvent(
|
PerfStatsEvent(
|
||||||
txId = batchedUpdate.frameTimeMs,
|
txId = batchedUpdate.frameTimeMs,
|
||||||
@@ -154,7 +158,8 @@ class TreeObserverManager(val context: UIDContext) {
|
|||||||
workerThreadStartTimestamp - batchedUpdate.updates.minOf { it.queuedTimestamp },
|
workerThreadStartTimestamp - batchedUpdate.updates.minOf { it.queuedTimestamp },
|
||||||
deferredComputationMS = (deferredComputationEndTimestamp - workerThreadStartTimestamp),
|
deferredComputationMS = (deferredComputationEndTimestamp - workerThreadStartTimestamp),
|
||||||
serializationMS = (serialisationEndTimestamp - deferredComputationEndTimestamp),
|
serializationMS = (serialisationEndTimestamp - deferredComputationEndTimestamp),
|
||||||
socketMS = (socketEndTimestamp - serialisationEndTimestamp))
|
socketMS = (socketEndTimestamp - serialisationEndTimestamp),
|
||||||
|
payloadSize = serialized.length)
|
||||||
|
|
||||||
context.connectionRef.connection?.send(
|
context.connectionRef.connection?.send(
|
||||||
PerfStatsEvent.name, Json.encodeToString(PerfStatsEvent.serializer(), perfStats))
|
PerfStatsEvent.name, Json.encodeToString(PerfStatsEvent.serializer(), perfStats))
|
||||||
|
|||||||
Reference in New Issue
Block a user