Documentation ¶
Overview ¶
Package snapshot contains code to generate Snapshots from ArchiveRecords, and utilities to load them from files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyRecord = errors.New("Message should contain Metadata or RawIDM")
ErrEmptyRecord is returned if an ArchivalRecord is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionLog ¶
ConnectionLog contains a Metadata and slice of Snapshots.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader wraps an ArchiveReader to provide a Snapshot reader.
func NewReader ¶
func NewReader(ar netlink.ArchiveReader) *Reader
NewReader wraps an ArchiveReader and provides Next()
type RouteAttrValue ¶
type RouteAttrValue []byte
RouteAttrValue is the type of RouteAttr.Value
func (RouteAttrValue) CongestionAlgorithm ¶
func (raw RouteAttrValue) CongestionAlgorithm() (string, bool)
CongestionAlgorithm returns the congestion algorithm string INET_DIAG_CONG
type Snapshot ¶
type Snapshot struct { // Timestamp of batch of messages containing this message. Timestamp time.Time // Bit field indicating whether each message type was observed. Observed uint32 // Bit field indicating whether any message type was NOT fully parsed. // TODO - populate this field if any message is ignored, or not fully parsed. NotFullyParsed uint32 `csv:",omitempty"` // Info from struct inet_diag_msg, including socket_id; InetDiagMsg *inetdiag.InetDiagMsg `csv:"-"` // From INET_DIAG_CONG message. CongestionAlgorithm string `csv:",omitempty"` // See https://tools.ietf.org/html/rfc3168 // TODO Do we need to record whether these are present and zero, vs absent? TOS uint8 `csv:",omitempty"` TClass uint8 `csv:",omitempty"` ClassID uint8 `csv:",omitempty"` // TODO Do we need to record present and zero, vs absent? Shutdown uint8 `csv:",omitempty"` // From INET_DIAG_PROTOCOL message. // TODO Do we need to record present and zero, vs absent? Protocol inetdiag.Protocol `csv:",omitempty"` Mark uint32 `csv:",omitempty"` // TCPInfo contains data from struct tcp_info. TCPInfo *tcp.LinuxTCPInfo `csv:"-"` // Data obtained from INET_DIAG_MEMINFO. MemInfo *inetdiag.MemInfo `csv:"-"` // Data obtained from INET_DIAG_SKMEMINFO. SocketMem *inetdiag.SocketMemInfo `csv:"-"` VegasInfo *inetdiag.VegasInfo `csv:"-"` DCTCPInfo *inetdiag.DCTCPInfo `csv:"-"` BBRInfo *inetdiag.BBRInfo `csv:"-"` }
Snapshot contains all info gathered through netlink library.
Click to show internal directories.
Click to hide internal directories.