Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix retransmission count are not consistent with the real value on Linux 4.7 or higher #450

Prev Previous commit
Next Next commit
fix: read segs from retransmit event
Signed-off-by: niejiangang <[email protected]>
  • Loading branch information
NeJan2020 committed Feb 14, 2023
commit 35793a081be636beae27806aada1ba6f6e166294
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ func (a *TcpMetricAnalyzer) generateRetransmit(event *model.KindlingEvent) (*mod
if err != nil {
return nil, err
}
metric := model.NewIntMetric(constnames.TcpRetransmitMetricName, 1)

var segs = int64(1)
p_segs := event.GetUserAttribute("segs")
if p_segs != nil && p_segs.GetValueType() == model.ValueType_INT32 {
segs = p_segs.GetIntValue()
}

metric := model.NewIntMetric(constnames.TcpRetransmitMetricName, segs)
return model.NewDataGroup(constnames.TcpRetransmitMetricGroupName, labels, event.Timestamp, metric), nil
}

Expand Down