-
Notifications
You must be signed in to change notification settings - Fork 2
/
result.go
38 lines (34 loc) · 895 Bytes
/
result.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package loaderbot
import (
"fmt"
"time"
)
type AttackResult struct {
AttackToken attackToken
Begin, End time.Time
Elapsed time.Duration
DoResult DoResult
}
func (a AttackResult) String() string {
return fmt.Sprintf(
"Begin: %s, End: %s, Elapsed: %d, token: [%s], doResult: %v",
a.Begin.Format(time.RFC3339),
a.End.Format(time.RFC3339),
a.Elapsed,
a.AttackToken,
a.DoResult,
)
}
// DoResult is the return value of a Do call on an Attack.
type DoResult struct {
// Label identifying the request that was send which is only used for reporting the Metrics.
RequestLabel string
// The error that happened when sending the request or receiving the response.
Error string
// The HTTP status code.
StatusCode int
// Number of bytes transferred when sending the request.
BytesIn int64
// Number of bytes transferred when receiving the response.
BytesOut int64
}