@@ -101,9 +101,9 @@ func (t *LoadTest) Run(ctx context.Context) error {
101
101
}
102
102
sort .Strings (names )
103
103
104
- fmt .Println ("\n Track loading:" )
105
104
testerTable := util .CreateTable ().
106
105
Headers ("Tester" , "Track" , "Kind" , "Pkts." , "Bitrate" , "Pkt. Loss" )
106
+
107
107
for n , name := range names {
108
108
testerStats := stats [name ]
109
109
summaries [name ] = getTesterSummary (testerStats )
@@ -142,14 +142,17 @@ func (t *LoadTest) Run(ctx context.Context) error {
142
142
}
143
143
144
144
}
145
- fmt .Println (testerTable )
145
+
146
+ if len (names ) > 0 {
147
+ fmt .Println ("\n Track loading:" )
148
+ fmt .Println (testerTable )
149
+ }
146
150
147
151
if len (summaries ) == 0 {
148
152
return nil
149
153
}
150
154
151
155
// tester summary
152
- fmt .Println ("\n Subscriber summaries:" )
153
156
summaryTable := util .CreateTable ().
154
157
Headers ("Tester" , "Tracks" , "Bitrate" , "Total Pkt. Loss" , "Error" ).
155
158
StyleFunc (func (row , col int ) lipgloss.Style {
@@ -178,6 +181,7 @@ func (t *LoadTest) Run(ctx context.Context) error {
178
181
)
179
182
summaryTable .Row ("Total" , fmt .Sprintf ("%d/%d" , s .tracks , s .expected ), sBitrate , sDropped , string (s .errCount ))
180
183
}
184
+ fmt .Println ("\n Subscriber summaries:" )
181
185
fmt .Println (summaryTable )
182
186
183
187
return nil
@@ -209,6 +213,7 @@ func (t *LoadTest) RunSuite(ctx context.Context) error {
209
213
210
214
table := util .CreateTable ().
211
215
Headers ("Pubs" , "Subs" , "Tracks" , "Audio" , "Video" , "Pkt. Loss" , "Errors" )
216
+ showTrackStats := false
212
217
213
218
for _ , c := range cases {
214
219
caseParams := t .Params
@@ -245,26 +250,34 @@ func (t *LoadTest) RunSuite(ctx context.Context) error {
245
250
errCount ++
246
251
}
247
252
}
248
- table .Row (
249
- strconv .Itoa (c .publishers ),
250
- strconv .Itoa (c .subscribers ),
251
- strconv .FormatInt (tracks , 10 ),
252
- "Yes" ,
253
- videoString ,
254
- formatLossRate (packets , dropped ),
255
- strconv .FormatInt (errCount , 10 ),
256
- )
253
+ if tracks > 0 {
254
+ showTrackStats = true
255
+ table .Row (
256
+ strconv .Itoa (c .publishers ),
257
+ strconv .Itoa (c .subscribers ),
258
+ strconv .FormatInt (tracks , 10 ),
259
+ "Yes" ,
260
+ videoString ,
261
+ formatLossRate (packets , dropped ),
262
+ strconv .FormatInt (errCount , 10 ),
263
+ )
264
+ }
257
265
}
258
266
259
- fmt .Println (table )
267
+ if showTrackStats {
268
+ fmt .Println ("\n Suite results:" )
269
+ fmt .Println (table )
270
+ }
260
271
return nil
261
272
}
262
273
263
274
func (t * LoadTest ) run (ctx context.Context , params Params ) (map [string ]* testerStats , error ) {
264
275
if params .Room == "" {
265
276
params .Room = fmt .Sprintf ("testroom%d" , rand .Int31n (1000 ))
266
277
}
267
- params .IdentityPrefix = randStringRunes (5 )
278
+ if params .IdentityPrefix == "" {
279
+ params .IdentityPrefix = randStringRunes (5 )
280
+ }
268
281
269
282
expectedTracks := params .VideoPublishers + params .AudioPublishers
270
283
0 commit comments