Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MaxLogSize is the size threshold at which the current trace file will be // rotated. The default value is 10Mb. MaxLogSize = 1024 * 1024 * 64 // MaxLogTime is the maximum amount of time a file will remain open before // being rotated. MaxLogTime = time.Hour )
Functions ¶
This section is empty.
Types ¶
type TraceCollector ¶
type TraceCollector struct {
// contains filtered or unexported fields
}
func NewTraceCollector ¶
func NewTraceCollector(host host.Host, dir, jsonTrace string) (*TraceCollector, error)
NewTraceCollector creates a new pubsub traces collector. A collector is a process that listens on a libp2p endpoint, accepts pubsub tracing streams from peers, and records the incoming data into rotating gzip files. If the json argument is not empty, then every time a new trace is generated, it will be written to this directory in json format for online processing.
func (*TraceCollector) Flush ¶
func (tc *TraceCollector) Flush()
Flush flushes and rotates the current file.
Click to show internal directories.
Click to hide internal directories.