Skip to content

Commit

Permalink
Merge pull request alibaba#281 from dzy176/main
Browse files Browse the repository at this point in the history
fix: sock metrics of tcp6
  • Loading branch information
Lyt99 authored May 21, 2024
2 parents 15fa61a + 9a3bbc1 commit 9b8a358
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 9b8a358

Please sign in to comment.