Skip to content

Commit 403a412

Browse files
committed
add rough size
1 parent ba36c8f commit 403a412

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

opentelemetry-sdk/src/logs/log_processor.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ type LogsData = Box<(LogRecord, InstrumentationScope)>;
337337
// ```
338338
// (max_queue_size + max_export_batch_size) * size of boxed (LogRecord + InstrumentationScope)
339339
// ```
340+
// - The average size of a `LogRecord` is ~300 bytes ( assuming 4 attributes), and the `InstrumentationScope` is ~50 bytes assuming no attributes.
341+
// - For `max_queue_size = 2048` and `max_export_batch_size = 512`, the total memory usage is ~900 KB as below:
342+
// Calculation: `(2048 + 512) * (300 + 50) = 2560 * 350 = 896000 bytes = 896 KB`.
340343
//
341344
// 6. **Key Notes on Memory Behavior**:
342345
// - Boxing a `LogRecord` and `InstrumentationScope` moves the record to the heap,

0 commit comments

Comments
 (0)