This patch modifies the `Destination` struct so that the stats for that destination are also reported. Signed-off-by: Akshay <akshay.moghe@gmail.com>
@@ -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