Documentation
¶
Index ¶
- type DecoderMetrics
- type DiskIOMetrics
- type ResolverMetrics
- type RuleMetrics
- type Tracker
- func (t *Tracker) Finalize()
- func (t *Tracker) RecordAbstractDecoder(name string, duration time.Duration)
- func (t *Tracker) RecordCustomDecoder(name string, duration time.Duration)
- func (t *Tracker) RecordDPI(duration time.Duration)
- func (t *Tracker) RecordDiskSync(fileName string, duration time.Duration)
- func (t *Tracker) RecordDiskWrite(fileName string, duration time.Duration, bytesWritten int64)
- func (t *Tracker) RecordFilterEvaluation(duration time.Duration, filtered bool)
- func (t *Tracker) RecordGoPacketDecoder(layerType string, duration time.Duration)
- func (t *Tracker) RecordPacketDecoding(duration time.Duration)
- func (t *Tracker) RecordReassembly(duration time.Duration)
- func (t *Tracker) RecordResolver(name string, duration time.Duration, cacheHit bool)
- func (t *Tracker) RecordRuleExecution(ruleName string, duration time.Duration, matched bool, alertGenerated bool)
- func (t *Tracker) RecordRulesEvaluation(duration time.Duration, alertsGenerated int)
- func (t *Tracker) RecordStreamDecoder(name string, duration time.Duration)
- func (t *Tracker) SetTotalPacketsAndBytes(packets, bytes int64)
- func (t *Tracker) UpdateDecoderRecords(decoderType, name string, records, bytes int64)
- func (t *Tracker) WriteReport(filename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DecoderMetrics ¶
type DecoderMetrics struct {
Name string
TotalNs int64 // Total time in nanoseconds
Count int64 // Number of invocations
Records int64 // Number of records produced
BytesOut int64 // Bytes written for this decoder
}
DecoderMetrics tracks metrics for a specific decoder
type DiskIOMetrics ¶
type DiskIOMetrics struct {
FileName string
WriteCount int64 // Number of write operations
WriteNs int64 // Total time in nanoseconds for writes
BytesOut int64 // Total bytes written
SyncCount int64 // Number of sync operations
SyncNs int64 // Total time in nanoseconds for syncs
}
DiskIOMetrics tracks disk I/O metrics for a specific file/type
type ResolverMetrics ¶
type ResolverMetrics struct {
Name string
TotalNs int64 // Total time in nanoseconds
Count int64 // Number of lookups
HitCount int64 // Number of cache hits (if tracked)
}
ResolverMetrics tracks metrics for a specific resolver
type RuleMetrics ¶
type RuleMetrics struct {
Name string
TotalNs int64 // Total time in nanoseconds
EvaluationCount int64 // Number of times rule was evaluated
MatchCount int64 // Number of times rule matched
AlertCount int64 // Number of alerts generated by this rule
}
RuleMetrics tracks metrics for a specific rule
type Tracker ¶
type Tracker struct {
// Packet processing metrics
TotalPackets int64
TotalBytes int64
PacketDecodingNs int64 // Total time spent decoding packets
PacketCount int64 // Count of packets decoded
// TCP reassembly metrics
ReassemblyNs int64 // Total time spent in TCP reassembly
ReassemblyCount int64 // Count of packets reassembled
// DPI metrics
DPICallsNs int64 // Total time in nanoseconds
DPICount int64 // Number of DPI calls
// Filter metrics
FilterEvaluationsNs int64 // Total time in nanoseconds
FilterEvaluations int64 // Number of filter evaluations
FilteredRecords int64 // Number of records filtered out
// Rules engine metrics
RulesEvaluationsNs int64 // Total time in nanoseconds
RulesEvaluations int64 // Number of rules evaluations
AlertsGenerated int64 // Number of alerts generated
// Timing
StartTime time.Time
EndTime time.Time
// contains filtered or unexported fields
}
Tracker tracks performance metrics for netcap operations
func (*Tracker) RecordAbstractDecoder ¶
RecordAbstractDecoder records metrics for an abstract decoder
func (*Tracker) RecordCustomDecoder ¶
RecordCustomDecoder records metrics for a custom decoder
func (*Tracker) RecordDiskSync ¶
RecordDiskSync records a disk sync operation
func (*Tracker) RecordDiskWrite ¶
RecordDiskWrite records a disk write operation
func (*Tracker) RecordFilterEvaluation ¶
RecordFilterEvaluation records time spent evaluating a filter
func (*Tracker) RecordGoPacketDecoder ¶
RecordGoPacketDecoder records metrics for a GoPacket decoder
func (*Tracker) RecordPacketDecoding ¶
RecordPacketDecoding records time spent decoding a packet
func (*Tracker) RecordReassembly ¶
RecordReassembly records time spent in TCP reassembly
func (*Tracker) RecordResolver ¶
RecordResolver records metrics for a resolver lookup
func (*Tracker) RecordRuleExecution ¶
func (t *Tracker) RecordRuleExecution(ruleName string, duration time.Duration, matched bool, alertGenerated bool)
RecordRuleExecution records metrics for a single rule execution
func (*Tracker) RecordRulesEvaluation ¶
RecordRulesEvaluation records time spent evaluating rules and number of alerts generated
func (*Tracker) RecordStreamDecoder ¶
RecordStreamDecoder records metrics for a stream decoder
func (*Tracker) SetTotalPacketsAndBytes ¶
SetTotalPacketsAndBytes sets the total packets and bytes processed
func (*Tracker) UpdateDecoderRecords ¶
UpdateDecoderRecords updates the record count and bytes for a decoder
func (*Tracker) WriteReport ¶
WriteReport writes a performance report to the specified file