Record thread cpu time for native modules thread

Summary: I want the same instrumentation we did for the JS thread for the NM thread.  This diff adds thread cpu time.

Reviewed By: alexeylang

Differential Revision: D13328876

fbshipit-source-id: 7b310956c52907ffbd881f864e1f8e774853d7f5
This commit is contained in:
Max Sherman
2018-12-05 12:16:00 -08:00
committed by Facebook Github Bot
parent 3f55e87d6f
commit 1fe947d956

View File

@@ -626,6 +626,7 @@ public class UIViewOperationQueue {
private long mProfiledBatchRunStartTime;
private long mProfiledBatchBatchedExecutionTime;
private long mProfiledBatchNonBatchedExecutionTime;
private long mThreadCpuTime;
public UIViewOperationQueue(
ReactApplicationContext reactContext,
@@ -664,6 +665,7 @@ public class UIViewOperationQueue {
perfMap.put("RunStartTime", mProfiledBatchRunStartTime);
perfMap.put("BatchedExecutionTime", mProfiledBatchBatchedExecutionTime);
perfMap.put("NonBatchedExecutionTime", mProfiledBatchNonBatchedExecutionTime);
perfMap.put("NativeModulesThreadCpuTime", mThreadCpuTime);
return perfMap;
}
@@ -866,6 +868,7 @@ public class UIViewOperationQueue {
.flush();
try {
final long dispatchViewUpdatesTime = SystemClock.uptimeMillis();
final long nativeModulesThreadCpuTime = SystemClock.currentThreadTimeMillis();
// Store the current operation queues to dispatch and create new empty ones to continue
// receiving new operations
@@ -920,6 +923,7 @@ public class UIViewOperationQueue {
mProfiledBatchLayoutTime = layoutTime;
mProfiledBatchDispatchViewUpdatesTime = dispatchViewUpdatesTime;
mProfiledBatchRunStartTime = runStartTime;
mThreadCpuTime = nativeModulesThreadCpuTime;
Systrace.beginAsyncSection(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,