Documentation
¶
Overview ¶
Package tracer provides functionality for tracing blockchain store operations by reading and parsing trace output from a FIFO pipe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct {
BlockHeight int64 `json:"blockHeight"`
StoreName string `json:"store_name"`
}
Metadata contains contextual information about a trace event.
type StoreTracer ¶
type StoreTracer struct {
Traces chan *Trace
// contains filtered or unexported fields
}
StoreTracer reads and parses store operation traces from a file or FIFO pipe.
func NewStoreTracer ¶
func NewStoreTracer(path string, createFifo bool) (*StoreTracer, error)
NewStoreTracer creates a new StoreTracer that reads from the specified path. If createFifo is true, a FIFO pipe will be created at the path. The tracer must be started with Start() to begin processing traces.
func (*StoreTracer) Start ¶
func (t *StoreTracer) Start()
Start begins processing trace events and sending them to the Traces channel. This method blocks until the tracer is stopped or the file is closed.
func (*StoreTracer) Stop ¶
func (t *StoreTracer) Stop() error
Stop stops the tracer and closes the underlying file.