MCPcopy Create free account
hub / github.com/chainreactors/spray / recordStat

Method recordStat

core/runner.go:85–102  ·  view source on GitHub ↗
(stat *pkg.Statistor)

Source from the content-addressed store, hash-verified

83}
84
85func (r *Runner) recordStat(stat *pkg.Statistor) {
86 if stat == nil {
87 return
88 }
89
90 targets := int64(1)
91 if r.IsCheck {
92 targets = int64(stat.Total)
93 }
94
95 r.statsMu.Lock()
96 defer r.statsMu.Unlock()
97 r.stats.Targets += targets
98 r.stats.Tasks += int64(stat.Total)
99 r.stats.Requests += int64(stat.ReqTotal)
100 r.stats.Results += int64(stat.FoundNumber)
101 r.stats.Errors += int64(stat.FailedNumber)
102}
103
104func (r *Runner) PrepareConfig() *pool.Config {
105 // 准备HTTP请求配置

Callers 4

RunWithCheckMethod · 0.95
PrintStatMethod · 0.95
TestRecordStat_NilStatFunction · 0.95

Calls

no outgoing calls

Tested by 2

TestRecordStat_NilStatFunction · 0.76