Skip to content

Commit

Permalink
Merge pull request #18 from andrewsykim/rename-stats-attr
Browse files Browse the repository at this point in the history
rename IPVS stats attributes since they apply for both services and destinations
  • Loading branch information
andrewsykim authored Apr 30, 2020
2 parents 4566cce + 8e80b27 commit d5d89be
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
24 changes: 12 additions & 12 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,20 @@ const (
ipvsDestAttrAddressFamily
)

// IPVS Svc Statistics constancs
// IPVS Statistics constants

const (
ipvsSvcStatsUnspec int = iota
ipvsSvcStatsConns
ipvsSvcStatsPktsIn
ipvsSvcStatsPktsOut
ipvsSvcStatsBytesIn
ipvsSvcStatsBytesOut
ipvsSvcStatsCPS
ipvsSvcStatsPPSIn
ipvsSvcStatsPPSOut
ipvsSvcStatsBPSIn
ipvsSvcStatsBPSOut
ipvsStatsUnspec int = iota
ipvsStatsConns
ipvsStatsPktsIn
ipvsStatsPktsOut
ipvsStatsBytesIn
ipvsStatsBytesOut
ipvsStatsCPS
ipvsStatsPPSIn
ipvsStatsPPSOut
ipvsStatsBPSIn
ipvsStatsBPSOut
)

// Destination forwarding methods
Expand Down
20 changes: 10 additions & 10 deletions netlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,25 +287,25 @@ func assembleStats(msg []byte) (SvcStats, error) {
for _, attr := range attrs {
attrType := int(attr.Attr.Type)
switch attrType {
case ipvsSvcStatsConns:
case ipvsStatsConns:
s.Connections = native.Uint32(attr.Value)
case ipvsSvcStatsPktsIn:
case ipvsStatsPktsIn:
s.PacketsIn = native.Uint32(attr.Value)
case ipvsSvcStatsPktsOut:
case ipvsStatsPktsOut:
s.PacketsOut = native.Uint32(attr.Value)
case ipvsSvcStatsBytesIn:
case ipvsStatsBytesIn:
s.BytesIn = native.Uint64(attr.Value)
case ipvsSvcStatsBytesOut:
case ipvsStatsBytesOut:
s.BytesOut = native.Uint64(attr.Value)
case ipvsSvcStatsCPS:
case ipvsStatsCPS:
s.CPS = native.Uint32(attr.Value)
case ipvsSvcStatsPPSIn:
case ipvsStatsPPSIn:
s.PPSIn = native.Uint32(attr.Value)
case ipvsSvcStatsPPSOut:
case ipvsStatsPPSOut:
s.PPSOut = native.Uint32(attr.Value)
case ipvsSvcStatsBPSIn:
case ipvsStatsBPSIn:
s.BPSIn = native.Uint32(attr.Value)
case ipvsSvcStatsBPSOut:
case ipvsStatsBPSOut:
s.BPSOut = native.Uint32(attr.Value)
}
}
Expand Down

0 comments on commit d5d89be

Please sign in to comment.