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

[Server] optimize analyzer distribution agent logs #5719

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions server/controller/http/service/rebalance/traffic.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ func (r *AnalyzerInfo) RebalanceAnalyzerByTraffic(ifCheckout bool, dataDuration
// update counter
updateCounter(vtapIDToName, vTapIDToChangeInfo)
}
log.Infof("vtap rebalance result switch_total_num(%v)", response.TotalSwitchVTapNum)
for _, detail := range response.Details {
log.Infof("vtap rebalance result az(%v) ip(%v) state(%v) before_vtap_num(%v) after_vtap_num(%v), switch_vtap_num(%v) before_vtap_weight(%v) after_vtap_weight(%v)",
detail.AZ, detail.IP, detail.State, detail.BeforeVTapNum, detail.AfterVTapNum, detail.SwitchVTapNum, detail.BeforeVTapWeights, detail.AfterVTapWeights)
if response.TotalSwitchVTapNum != 0 {
log.Infof("vtap rebalance result switch_total_num(%v)", response.TotalSwitchVTapNum)
for _, detail := range response.Details {
log.Infof("vtap rebalance result az(%v) ip(%v) state(%v) before_vtap_num(%v) after_vtap_num(%v), switch_vtap_num(%v) before_vtap_weight(%v) after_vtap_weight(%v)",
detail.AZ, detail.IP, detail.State, detail.BeforeVTapNum, detail.AfterVTapNum, detail.SwitchVTapNum, detail.BeforeVTapWeights, detail.AfterVTapWeights)
}
}

return response, nil
Expand Down Expand Up @@ -542,8 +544,8 @@ func updateCounter(vtapIDToName map[int]string, vtapIDToChangeInfo map[int]*Chan
log.Error(err)
}
} else {
log.Infof("agent(%v) update weight: %v -> %v", name, counter.VTapWeightCounter.Weight, changeInfo.NewWeight)
log.Infof("agent(%v) update is_analyzer_changed: %v -> %v", name, counter.VTapWeightCounter.IsAnalyzerChanged, isAnalyzerChanged)
log.Debugf("agent(%v) update weight: %v -> %v", name, counter.VTapWeightCounter.Weight, changeInfo.NewWeight)
log.Debugf("agent(%v) update is_analyzer_changed: %v -> %v", name, counter.VTapWeightCounter.IsAnalyzerChanged, isAnalyzerChanged)
counter.VTapWeightCounter.Weight = changeInfo.NewWeight
counter.VTapWeightCounter.IsAnalyzerChanged = isAnalyzerChanged
}
Expand Down
5 changes: 3 additions & 2 deletions server/controller/monitor/vtap/rebalance.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ func (r *RebalanceCheck) analyzerRebalanceByTraffic(dataDuration int) {
}
if result.TotalSwitchVTapNum != 0 {
log.Infof("need rebalance, total switch vtap num(%d)", result.TotalSwitchVTapNum)
_, err := analyzerInfo.RebalanceAnalyzerByTraffic(false, dataDuration)
log.Errorf("fail to rebalance analyzer by data(if check: false): %v", err)
if _, err := analyzerInfo.RebalanceAnalyzerByTraffic(false, dataDuration); err != nil {
log.Errorf("fail to rebalance analyzer by data(if check: false): %v", err)
}
return
}
}
Loading