Skip to content

Commit c7696d7

Browse files
added section in the readme
1 parent 8bf6e7f commit c7696d7

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,42 @@ and a **ROS2 bridge** that maps `LogLevel` to `RCLCPP_*` macros.
324324

325325
---
326326

327+
## Tracing
328+
329+
The SDK includes built-in support for [Chromium tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool/), allowing you to capture detailed performance traces for debugging and optimization.
330+
331+
### Basic Usage
332+
333+
```cpp
334+
#include <livekit/livekit.h>
335+
336+
// Start tracing to a file
337+
livekit::startTracing("trace.json");
338+
339+
// ... run your application ...
340+
341+
// Stop tracing and flush to file
342+
livekit::stopTracing();
343+
```
344+
345+
### Filtering by Category
346+
347+
You can optionally filter which categories to trace:
348+
349+
```cpp
350+
// Trace only specific categories (supports wildcards)
351+
livekit::startTracing("trace.json", {"livekit.*", "webrtc.*"});
352+
```
353+
354+
### Viewing Traces
355+
356+
Open the generated trace file in one of these viewers:
357+
358+
1. **Chrome**: Navigate to `chrome://tracing` and click "Load" to open the trace file
359+
2. **Perfetto**: Go to https://ui.perfetto.dev and drag-drop your trace file
360+
361+
---
362+
327363
## 🧪 Integration & Stress Tests
328364

329365
The SDK includes integration and stress tests using Google Test (gtest).

src/tests/common/test_common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <iomanip>
2626
#include <iostream>
2727
#include <livekit/livekit.h>
28-
#include <livekit/tracing.h>
2928
#include <map>
3029
#include <memory>
3130
#include <mutex>

src/tests/stress/test_latency_measurement.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ TEST_F(LatencyMeasurementTest, ConnectionTime) {
285285

286286
RoomOptions options;
287287
options.auto_subscribe = true;
288+
LatencyStats stats;
288289
int successful_connections = 0;
289290

290291
for (int i = 0; i < config_.test_iterations; ++i) {

0 commit comments

Comments
 (0)