Skip to content

Commit 7bf98e3

Browse files
bugfix: 修正错误的请求次数计数
1 parent 7b5f877 commit 7bf98e3

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

  • packages/mitmproxy/src/lib/choice

packages/mitmproxy/src/lib/choice/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,11 @@ class DynamicChoice {
109109
}
110110

111111
if (isError) {
112-
// 失败次数+1,累计连续失败次数+1
113-
count.error++
114-
count.keepErrorCount++
115-
} else {
116-
// 总次数+1
117-
count.total++
112+
count.error++ // 失败次数+1
113+
count.keepErrorCount++ // 累计连续失败次数+1
118114
}
115+
count.total++ // 总次数+1
116+
119117
// 计算成功率
120118
count.successRate = 1.0 - (count.error / count.total)
121119
if (isError && this.value === ip) {

0 commit comments

Comments
 (0)