diff --git a/internal/rpc/call_stat.go b/internal/rpc/call_stat.go index faa15dc..4bfdc77 100644 --- a/internal/rpc/call_stat.go +++ b/internal/rpc/call_stat.go @@ -45,8 +45,13 @@ func (this *CallStat) Sum() (successPercent float64, avgCostSeconds float64) { this.locker.Lock() defer this.locker.Unlock() + var size = this.size + if size <= 0 { + size = 10 + } + var totalItems = len(this.items) - if totalItems == 0 { + if totalItems <= size/2 /** 低于一半的采样率,不计入统计 **/ { successPercent = 100 return }