MCPcopy
hub / github.com/XIU2/CloudflareSpeedTest / getLossRate

Method getLossRate

utils/csv.go:54–60  ·  view source on GitHub ↗

计算丢包率

()

Source from the content-addressed store, hash-verified

52
53// 计算丢包率
54func (cf *CloudflareIPData) getLossRate() float32 {
55 if cf.lossRate == 0 {
56 pingLost := cf.Sended - cf.Received
57 cf.lossRate = float32(pingLost) / float32(cf.Sended)
58 }
59 return cf.lossRate
60}
61
62func (cf *CloudflareIPData) toString() []string {
63 result := make([]string, 7)

Callers 3

toStringMethod · 0.95
FilterLossRateMethod · 0.80
LessMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected