package testkit
Import Path
internal/trace/internal/testgen/go122 (on go.dev)
Dependency Relation
imports 12 packages, and imported by 0 packages
Involved Source Files
trace.go
Package-Level Type Names (total 5)
Batch represents an event batch.
Event emits an event into a batch. name must correspond to one
of the names in Specs() result for the version that was passed to
this trace. Callers must omit the timestamp delta.
RawEvent emits an event into a batch. name must correspond to one
of the names in Specs() result for the version that was passed to
this trace.
func (*Generation).Batch(thread trace.ThreadID, time Time) *Batch
Generation represents a single generation in the trace.
Batch starts a new event batch in the trace data.
This is convenience function for generating correct batches.
Stack registers a stack with the trace.
This is a convenience function for easily adding correct
stacks to traces.
String registers a string with the trace.
This is a convenience function for easily adding correct
strings to traces.
func (*Trace).Generation(gen uint64) *Generation
Seq represents a sequence counter.
Time represents a low-level trace timestamp (which does not necessarily
correspond to nanoseconds, like trace.Time does).
func (*Generation).Batch(thread trace.ThreadID, time Time) *Batch
Trace represents an execution trace for testing.
It does a little bit of work to ensure that the produced trace is valid,
just for convenience. It mainly tracks batches and batch sizes (so they're
trivially correct), tracks strings and stacks, and makes sure emitted string
and stack batches are valid. That last part can be controlled by a few options.
Otherwise, it performs no validation on the trace at all.
DisableTimestamps makes the timestamps for all events generated after
this call zero. Raw events are exempted from this because the caller
has to pass their own timestamp into those events anyway.
ExpectFailure writes down that the trace should be broken. The caller
must provide a pattern matching the expected error produced by the parser.
ExpectSuccess writes down that the trace should successfully parse.
Generate creates a test file for the trace.
Generation creates a new trace generation.
This provides more structure than Event to allow for more easily
creating complex traces that are mostly or completely correct.
RawEvent emits an event into the trace. name must correspond to one
of the names in Specs() result for the version that was passed to
this trace.
func NewTrace() *Trace
The pages are generated with Golds v0.6.9-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |