mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
API to report events
Summary: Extends the WebPerformance API with ability to report events, [according to the standard](https://www.w3.org/TR/event-timing/#sec-performance-event-timing). This is an API-only change, the actual reporting comes in a separate diff, to simplify reviewing. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D42097695 fbshipit-source-id: d8b468ffed50c1c3d889151df5e8ca644d6e1a68
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d09c5fd7a9
commit
4eecab3a76
@@ -167,6 +167,26 @@ double PerformanceEntryReporter::getMarkTime(
|
||||
}
|
||||
}
|
||||
|
||||
void PerformanceEntryReporter::event(
|
||||
const std::string &name,
|
||||
double startTime,
|
||||
double duration,
|
||||
bool isFirstInput,
|
||||
double processingStart,
|
||||
double processingEnd,
|
||||
uint32_t interactionId) {
|
||||
logEntry(
|
||||
{name,
|
||||
static_cast<int>(
|
||||
isFirstInput ? PerformanceEntryType::FIRST_INPUT
|
||||
: PerformanceEntryType::MEASURE),
|
||||
startTime,
|
||||
duration,
|
||||
processingStart,
|
||||
processingEnd,
|
||||
interactionId});
|
||||
}
|
||||
|
||||
void PerformanceEntryReporter::clearEntries(
|
||||
std::function<bool(const RawPerformanceEntry &)> predicate) {
|
||||
int lastPos = entries_.size() - 1;
|
||||
|
||||
Reference in New Issue
Block a user