add pcap stats to weave report

Closes #1185.
This commit is contained in:
Matthias Radestock committed 2015-08-11 12:57:52 +01:00
1 parent f3ad81d554
commit c1d799a06c
3 files changed
+21

No files matched your search

+12
View File
@@ -84,3 +84,15 @@ func (pio *PcapIO) ReadPacket() (data []byte, err error) {
func (pio *PcapIO) WritePacket(data []byte) error {
return pio.handle.WritePacketData(data)
}
func (pio *PcapIO) Stats() map[string]int {
stats, err := pio.handle.Stats()
if err != nil {
return nil
}
res := make(map[string]int)
res["PacketsReceived"] = stats.PacketsReceived
res["PacketsDropped"] = stats.PacketsDropped
res["PacketsIfDropped"] = stats.PacketsIfDropped
return res
}