@@ -101,9 +101,9 @@ func (t *LoadTest) Run(ctx context.Context) error {
101101 }
102102 sort .Strings (names )
103103
104- fmt .Println ("\n Track loading:" )
105104 testerTable := util .CreateTable ().
106105 Headers ("Tester" , "Track" , "Kind" , "Pkts." , "Bitrate" , "Pkt. Loss" )
106+
107107 for n , name := range names {
108108 testerStats := stats [name ]
109109 summaries [name ] = getTesterSummary (testerStats )
@@ -142,14 +142,17 @@ func (t *LoadTest) Run(ctx context.Context) error {
142142 }
143143
144144 }
145- fmt .Println (testerTable )
145+
146+ if len (names ) > 0 {
147+ fmt .Println ("\n Track loading:" )
148+ fmt .Println (testerTable )
149+ }
146150
147151 if len (summaries ) == 0 {
148152 return nil
149153 }
150154
151155 // tester summary
152- fmt .Println ("\n Subscriber summaries:" )
153156 summaryTable := util .CreateTable ().
154157 Headers ("Tester" , "Tracks" , "Bitrate" , "Total Pkt. Loss" , "Error" ).
155158 StyleFunc (func (row , col int ) lipgloss.Style {
@@ -178,6 +181,7 @@ func (t *LoadTest) Run(ctx context.Context) error {
178181 )
179182 summaryTable .Row ("Total" , fmt .Sprintf ("%d/%d" , s .tracks , s .expected ), sBitrate , sDropped , string (s .errCount ))
180183 }
184+ fmt .Println ("\n Subscriber summaries:" )
181185 fmt .Println (summaryTable )
182186
183187 return nil
@@ -209,6 +213,7 @@ func (t *LoadTest) RunSuite(ctx context.Context) error {
209213
210214 table := util .CreateTable ().
211215 Headers ("Pubs" , "Subs" , "Tracks" , "Audio" , "Video" , "Pkt. Loss" , "Errors" )
216+ showTrackStats := false
212217
213218 for _ , c := range cases {
214219 caseParams := t .Params
@@ -245,26 +250,34 @@ func (t *LoadTest) RunSuite(ctx context.Context) error {
245250 errCount ++
246251 }
247252 }
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+ }
257265 }
258266
259- fmt .Println (table )
267+ if showTrackStats {
268+ fmt .Println ("\n Suite results:" )
269+ fmt .Println (table )
270+ }
260271 return nil
261272}
262273
263274func (t * LoadTest ) run (ctx context.Context , params Params ) (map [string ]* testerStats , error ) {
264275 if params .Room == "" {
265276 params .Room = fmt .Sprintf ("testroom%d" , rand .Int31n (1000 ))
266277 }
267- params .IdentityPrefix = randStringRunes (5 )
278+ if params .IdentityPrefix == "" {
279+ params .IdentityPrefix = randStringRunes (5 )
280+ }
268281
269282 expectedTracks := params .VideoPublishers + params .AudioPublishers
270283
0 commit comments