Skip to content

Commit f718571

Browse files
rubennortefacebook-github-bot
authored andcommitted
Remove unnecessary collectEvents method from PerformanceTracer (#52936)
Summary: Pull Request resolved: #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
1 parent 384fc54 commit f718571

2 files changed

Lines changed: 0 additions & 36 deletions

File tree

packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -101,36 +101,6 @@ void PerformanceTracer::collectEvents(
101101
}
102102
}
103103

104-
folly::dynamic PerformanceTracer::collectEvents(uint16_t chunkSize) {
105-
std::vector<TraceEvent> localBuffer;
106-
{
107-
std::lock_guard lock(mutex_);
108-
buffer_.swap(localBuffer);
109-
}
110-
111-
auto chunks = folly::dynamic::array();
112-
if (localBuffer.empty()) {
113-
return chunks;
114-
}
115-
116-
auto chunk = folly::dynamic::array();
117-
chunk.reserve(chunkSize);
118-
for (auto&& event : localBuffer) {
119-
chunk.push_back(TraceEventSerializer::serialize(std::move(event)));
120-
121-
if (chunk.size() == chunkSize) {
122-
chunks.push_back(std::move(chunk));
123-
chunk = folly::dynamic::array();
124-
chunk.reserve(chunkSize);
125-
}
126-
}
127-
128-
if (!chunk.empty()) {
129-
chunks.push_back(std::move(chunk));
130-
}
131-
return chunks;
132-
}
133-
134104
std::vector<TraceEvent> PerformanceTracer::collectTraceEvents() {
135105
std::vector<TraceEvent> events;
136106
{

packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ class PerformanceTracer {
5959
const std::function<void(folly::dynamic&& eventsChunk)>& resultCallback,
6060
uint16_t chunkSize);
6161

62-
/**
63-
* Flush out buffered CDP Trace Events into a folly::dynamic collection of
64-
* chunks, which can be sent over CDP later.
65-
*/
66-
folly::dynamic collectEvents(uint16_t chunkSize);
67-
6862
/**
6963
* Transfers an ownership of all buffered TraceEvents, the local buffer state
7064
* is invalidated after this call.

0 commit comments

Comments
 (0)