mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Remove unnecessary collectEvents method from PerformanceTracer (#52936)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52936 Changelog: [internal] This method is unused and we're no longer planning to use it. Reviewed By: hoxyq Differential Revision: D79271691 fbshipit-source-id: 1a0be464928a199cfe4a57cb5c44255b127264c2
This commit is contained in:
1 parent
384fc5447d
commit
f7185715df
2 files changed
-36
No files matched your search
@@ -101,36 +101,6 @@ void PerformanceTracer::collectEvents(
|
||||
}
|
||||
}
|
||||
|
||||
folly::dynamic PerformanceTracer::collectEvents(uint16_t chunkSize) {
|
||||
std::vector<TraceEvent> localBuffer;
|
||||
{
|
||||
std::lock_guard lock(mutex_);
|
||||
buffer_.swap(localBuffer);
|
||||
}
|
||||
|
||||
auto chunks = folly::dynamic::array();
|
||||
if (localBuffer.empty()) {
|
||||
return chunks;
|
||||
}
|
||||
|
||||
auto chunk = folly::dynamic::array();
|
||||
chunk.reserve(chunkSize);
|
||||
for (auto&& event : localBuffer) {
|
||||
chunk.push_back(TraceEventSerializer::serialize(std::move(event)));
|
||||
|
||||
if (chunk.size() == chunkSize) {
|
||||
chunks.push_back(std::move(chunk));
|
||||
chunk = folly::dynamic::array();
|
||||
chunk.reserve(chunkSize);
|
||||
}
|
||||
}
|
||||
|
||||
if (!chunk.empty()) {
|
||||
chunks.push_back(std::move(chunk));
|
||||
}
|
||||
return chunks;
|
||||
}
|
||||
|
||||
std::vector<TraceEvent> PerformanceTracer::collectTraceEvents() {
|
||||
std::vector<TraceEvent> events;
|
||||
{
|
||||
|
||||
@@ -59,12 +59,6 @@ class PerformanceTracer {
|
||||
const std::function<void(folly::dynamic&& eventsChunk)>& resultCallback,
|
||||
uint16_t chunkSize);
|
||||
|
||||
/**
|
||||
* Flush out buffered CDP Trace Events into a folly::dynamic collection of
|
||||
* chunks, which can be sent over CDP later.
|
||||
*/
|
||||
folly::dynamic collectEvents(uint16_t chunkSize);
|
||||
|
||||
/**
|
||||
* Transfers an ownership of all buffered TraceEvents, the local buffer state
|
||||
* is invalidated after this call.
|
||||
|
||||
Reference in new issue
Block a user