Add Time Series History and Renderer for rendering time series chart (#39480)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39480

Changelog:
[Internal] - Separate the time series data and renderer logic from performance monitor overlay so that it can be swapped later to C++ for cross-platform support.

Reviewed By: rshest

Differential Revision: D49321748

fbshipit-source-id: fbb781ef710b134130bfd80dada00748e73d5f24
This commit is contained in:
Xin Chen
2023-10-19 22:59:44 -07:00
committed by Facebook GitHub Bot
parent 30b9b01e68
commit c05448bf5c
2 changed files with 14 additions and 0 deletions
@@ -58,4 +58,14 @@ public class UiThreadUtil {
}
sMainHandler.postDelayed(runnable, delayInMs);
}
/** Removes the given {@code Runnable} on the UI thread. */
public static void removeOnUiThread(Runnable runnable) {
synchronized (UiThreadUtil.class) {
if (sMainHandler == null) {
sMainHandler = new Handler(Looper.getMainLooper());
}
}
sMainHandler.removeCallbacks(runnable);
}
}
@@ -126,6 +126,10 @@ public class DevToolsReactPerfLogger implements ReactMarker.FabricMarkerListener
return getCounter(FABRIC_LAYOUT_AFFECTED_NODES);
}
public long getAffectedLayoutNodesCountTime() {
return getTimestamp(FABRIC_LAYOUT_AFFECTED_NODES);
}
public long getBatchExecutionStart() {
return getTimestamp(FABRIC_BATCH_EXECUTION_START);
}