@@ -28,7 +28,7 @@ import (
28
28
type Config struct {
29
29
Workers int
30
30
Traces int
31
- Marshall bool
31
+ Marshal bool
32
32
Debug bool
33
33
Pause time.Duration
34
34
Duration time.Duration
@@ -38,33 +38,33 @@ type Config struct {
38
38
func (c * Config ) Flags (fs * flag.FlagSet ) {
39
39
fs .IntVar (& c .Workers , "workers" , 1 , "Number of workers (goroutines) to run" )
40
40
fs .IntVar (& c .Traces , "traces" , 1 , "Number of traces to generate in each worker (ignored if duration is provided" )
41
- fs .BoolVar (& c .Marshall , "marshall " , false , "Whether to marshall trace context via HTTP headers" )
41
+ fs .BoolVar (& c .Marshal , "marshal " , false , "Whether to marshal trace context via HTTP headers" )
42
42
fs .BoolVar (& c .Debug , "debug" , false , "Whether to set DEBUG flag on the spans to prevent downsampling" )
43
43
fs .DurationVar (& c .Pause , "pause" , time .Microsecond , "How long to pause before finishing trace" )
44
44
fs .DurationVar (& c .Duration , "duration" , 0 , "For how long to run the test" )
45
45
}
46
46
47
47
// Run executes the test scenario.
48
- func (c * Config ) Run ( logger * zap.Logger ) error {
48
+ func Run (c * Config , logger * zap.Logger ) error {
49
49
if c .Duration > 0 {
50
50
c .Traces = 0
51
51
} else if c .Traces <= 0 {
52
52
return fmt .Errorf ("Either `traces` or `duration` must be greater than 0" )
53
53
}
54
54
55
- wg := & sync.WaitGroup {}
55
+ wg := sync.WaitGroup {}
56
56
var running uint32 = 1
57
57
for i := 0 ; i < c .Workers ; i ++ {
58
58
wg .Add (1 )
59
59
w := worker {
60
60
id : i ,
61
61
traces : c .Traces ,
62
- marshall : c . Marshall ,
62
+ marshal : c . Marshal ,
63
63
debug : c .Debug ,
64
64
pause : c .Pause ,
65
65
duration : c .Duration ,
66
66
running : & running ,
67
- wg : wg ,
67
+ wg : & wg ,
68
68
logger : logger .With (zap .Int ("worker" , i )),
69
69
}
70
70
0 commit comments