Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateEventGraphviz(out io.Writer, traffics ...*Traffic)
- func GenerateItemsGraphviz(out io.Writer, withSend, withRcv bool, traffics ...*Traffic)
- func SaveEvents(path string) error
- func SaveItems(path string, withSend, withRcv bool) error
- type Event
- type Traffic
- func (t *Traffic) Display(out io.Writer)
- func (t *Traffic) LogRecv(ctx context.Context, gateway mino.Address, pkt router.Packet)
- func (t *Traffic) LogRelay(to mino.Address)
- func (t *Traffic) LogRelayClosed(to mino.Address)
- func (t *Traffic) LogSend(ctx context.Context, gateway mino.Address, pkt router.Packet)
- func (t *Traffic) Save(path string, withSend, withRcv bool) error
- type Watcher
Constants ¶
View Source
const EnvVariable = "MINO_TRAFFIC"
EnvVariable is the name of the environment variable to enable the traffic.
Variables ¶
View Source
var ( // LogItems allows one to granularly say when items should be logged or not. // This is useful for example in an integration test where a specific part // raises a problem but the full graph would be too noisy. For that, one // can set LogItems = false and change it to true when needed. LogItems = true // LogEvent works the same as LogItems but for events. Note that in both // cases the varenv should be set. LogEvent = true )
View Source
var GlobalWatcher = Watcher{ // contains filtered or unexported fields }
GlobalWatcher can be used to watch for sent and received messages.
Functions ¶
func GenerateEventGraphviz ¶
GenerateEventGraphviz creates a graphviz representation of the events
func GenerateItemsGraphviz ¶
GenerateItemsGraphviz creates a graphviz representation of the items. One can generate a graphical representation with `dot -Tpdf graph.dot -o graph.pdf`
Types ¶
type Traffic ¶
Traffic is used to keep track of packets Traffic in a server
func NewTraffic ¶
NewTraffic creates a new empty traffic recorder.
func (*Traffic) LogRecv ¶
LogRecv records a packet received by the node. The sender is the gateway and the receiver the node.
func (*Traffic) LogRelayClosed ¶
LogRelayClosed records the end of a relay.
Click to show internal directories.
Click to hide internal directories.