mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Implement EventCounts Web Performance API for React Native (#36181)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36181 [Changelog][Internal] Implements EventCounts API (`Performance.eventCounts`) for Web Performance, according to the W3C standard, see the specs here: https://www.w3.org/TR/event-timing/#eventcounts The rationale for why we need it is to support some advanced metrics computations, such as a ratio of "slow events" to total event count, per event type. Reviewed By: rubennorte Differential Revision: D43285073 fbshipit-source-id: 2c53d04d9a57c1301e37f2a5879072c8d33efbbf
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8486e191a1
commit
581357bc9b
@@ -51,4 +51,12 @@ void NativePerformanceObserver::logRawEntry(
|
||||
PerformanceEntryReporter::getInstance().logEntry(entry);
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, uint32_t>>
|
||||
NativePerformanceObserver::getEventCounts(jsi::Runtime &rt) {
|
||||
const auto &eventCounts =
|
||||
PerformanceEntryReporter::getInstance().getEventCounts();
|
||||
return std::vector<std::pair<std::string, uint32_t>>(
|
||||
eventCounts.begin(), eventCounts.end());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
Reference in New Issue
Block a user