Add `Stats` to the `Destination`
This patch modifies the `Destination` struct so that the stats for that destination are also reported. Signed-off-by: Akshay <akshay.moghe@gmail.com>
This commit is contained in:
parent
9b39ca36c7
commit
e427c4ee2e
|
@ -62,6 +62,7 @@ type Destination struct {
|
|||
LowerThreshold uint32
|
||||
ActiveConnections int
|
||||
InactiveConnections int
|
||||
Stats SvcStats
|
||||
}
|
||||
|
||||
// Handle provides a namespace specific ipvs handle to program ipvs
|
||||
|
|
|
@ -443,6 +443,12 @@ func assembleDestination(attrs []syscall.NetlinkRouteAttr) (*Destination, error)
|
|||
d.ActiveConnections = int(native.Uint16(attr.Value))
|
||||
case ipvsDestAttrInactiveConnections:
|
||||
d.InactiveConnections = int(native.Uint16(attr.Value))
|
||||
case ipvsSvcAttrStats:
|
||||
stats, err := assembleStats(attr.Value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
d.Stats = stats
|
||||
}
|
||||
}
|
||||
return &d, nil
|
||||
|
|
Loading…
Reference in New Issue