diff options
| author | Will Hawkins <[email protected]> | 2022-11-20 02:33:51 -0500 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2022-11-20 02:39:09 -0500 |
| commit | bad6c4655200dacd75ce1451cd3f410fea3d8de2 (patch) | |
| tree | 9e98ed51547d8e432c4a59f1ad1b2300bbc8c734 | |
| parent | 78fb5b1f49672d982208ddf80a0b77b8839ed0ae (diff) | |
[Feature] Add structure for wrapping collection of LGCs
Add a structure for wrapping a collection of load-generating
connections so that two or more parallel tasks can access
them safely.
| -rw-r--r-- | lgc/lgc.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -22,6 +22,7 @@ import ( "io/ioutil" "net/http" "net/http/httptrace" + "sync" "sync/atomic" "time" @@ -41,6 +42,15 @@ type LoadGeneratingConnection interface { Stats() *stats.TraceStats } +type LoadGeneratingConnectionCollection struct { + Lock sync.Mutex + LGCs *[]LoadGeneratingConnection +} + +func NewLoadGeneratingConnectionCollection() LoadGeneratingConnectionCollection { + return LoadGeneratingConnectionCollection{LGCs: new([]LoadGeneratingConnection)} +} + // TODO: All 64-bit fields that are accessed atomically must // appear at the top of this struct. type LoadGeneratingConnectionDownload struct { |
