reporttest

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package reporttest builds synthetic Gatling logs for tests and benchmarks.

A recorded log is a few kilobytes; the memory goal is about logs of gigabytes. Replay yields a text log of any size from one recording without writing a file or holding the log in memory, which is what lets a test measure the reader rather than the fixture.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Replay

func Replay(header, body []byte, n int) io.Reader

Replay returns a reader that yields header once and then body n times. Reads are served from the recording's bytes directly; nothing is copied ahead of time, so a replay of gigabytes costs the size of one recording.

A negative n yields the header alone, as zero does.

func Split

func Split(log []byte) (header, body []byte, err error)

Split divides a text simulation.log into its header — every line through the RUN record — and its body, the events after it. Both keep their trailing newline, so header followed by body is the log again.

The header is capped to its own length, so appending to it cannot reach into the body it was cut from. A log whose last line is unterminated is refused: its body would end mid-record, and repeating it would splice that record onto the next copy's first one.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL