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
@@ -47,7 +47,12 @@ GetPendingEntriesResult PerformanceEntryReporter::popPendingEntries() {
|
||||
}
|
||||
|
||||
void PerformanceEntryReporter::logEntry(const RawPerformanceEntry &entry) {
|
||||
if (!isReportingType(static_cast<PerformanceEntryType>(entry.entryType))) {
|
||||
const auto entryType = static_cast<PerformanceEntryType>(entry.entryType);
|
||||
if (entryType == PerformanceEntryType::EVENT) {
|
||||
eventCounts_[entry.name]++;
|
||||
}
|
||||
|
||||
if (!isReportingType(entryType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user