Skip to content

Commit

Permalink
fix: sock metrics of tcp6
Browse files Browse the repository at this point in the history
  • Loading branch information
dzy176 committed May 20, 2024
1 parent 15fa61a commit 9a3bbc1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/exporter/probe/procsock/procsock.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ func getHostTCPSockstat() (tcpsockstat, error) {
return res, nil
}
for idx := range stat6.Protocols {
if strings.Compare(stat.Protocols[idx].Protocol, "TCP") == 0 {
res.InUse += stat.Protocols[idx].InUse
res.Orphan += *stat.Protocols[idx].Orphan
res.Alloc += *stat.Protocols[idx].Alloc
res.TW += *stat.Protocols[idx].TW
res.Mem += *stat.Protocols[idx].Mem
if strings.Compare(stat6.Protocols[idx].Protocol, "TCP6") == 0 {
res.InUse += stat6.Protocols[idx].InUse
res.Orphan += *stat6.Protocols[idx].Orphan
res.Alloc += *stat6.Protocols[idx].Alloc
res.TW += *stat6.Protocols[idx].TW
res.Mem += *stat6.Protocols[idx].Mem
}
}

Expand Down

0 comments on commit 9a3bbc1

Please sign in to comment.