Skip to main content

TextRingBufferOptions

Options for createTextRingBuffer.

Properties​

PropertyTypeDefault valueDescription
segmentByteSize?number524288 (512 KiB)Byte capacity of a single segment. Lines never straddle segments, so this is also the largest line, in bytes, which can be stored without being truncated.
segmentCount?number8Number of segments retained in memory. The buffer never holds more than segmentByteSize * segmentCount bytes of log data, apart from while onSegmentSealed runs, where a couple of extra segments may be held because the memory handed to the callee cannot be reused yet.
maxLinesPerSegment?number2048Maximum number of lines a single segment can hold. Bounds the size of the per-segment line table.
onSegmentSealed?OnSegmentSealedundefinedOptional hook invoked when a segment is sealed.