Add ifIndex support
This commit is contained in:
parent
7ffe40e0db
commit
1f9466536e
|
@ -26,6 +26,7 @@ type IOCountersStat struct {
|
||||||
Dropout uint64 `json:"dropout"` // total number of outgoing packets which were dropped (always 0 on OSX and BSD)
|
Dropout uint64 `json:"dropout"` // total number of outgoing packets which were dropped (always 0 on OSX and BSD)
|
||||||
Fifoin uint64 `json:"fifoin"` // total number of FIFO buffers errors while receiving
|
Fifoin uint64 `json:"fifoin"` // total number of FIFO buffers errors while receiving
|
||||||
Fifoout uint64 `json:"fifoout"` // total number of FIFO buffers errors while sending
|
Fifoout uint64 `json:"fifoout"` // total number of FIFO buffers errors while sending
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Addr is implemented compatibility to psutil
|
// Addr is implemented compatibility to psutil
|
||||||
|
@ -121,7 +122,6 @@ func InterfacesWithContext(ctx context.Context) ([]InterfaceStat, error) {
|
||||||
for _, ifi := range is {
|
for _, ifi := range is {
|
||||||
|
|
||||||
var flags []string
|
var flags []string
|
||||||
|
|
||||||
if ifi.Flags&net.FlagUp != 0 {
|
if ifi.Flags&net.FlagUp != 0 {
|
||||||
flags = append(flags, "up")
|
flags = append(flags, "up")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue