Skip to content

Commit

Permalink
chore(cmd): bump version (#493)
Browse files Browse the repository at this point in the history
* chore(load-test): don't print empty tables

* chore(cmd): bump version
  • Loading branch information
rektdeckard authored Jan 1, 2025
1 parent 41edab4 commit 97b5c86
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
41 changes: 27 additions & 14 deletions pkg/loadtester/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ func (t *LoadTest) Run(ctx context.Context) error {
}
sort.Strings(names)

fmt.Println("\nTrack loading:")
testerTable := util.CreateTable().
Headers("Tester", "Track", "Kind", "Pkts.", "Bitrate", "Pkt. Loss")

for n, name := range names {
testerStats := stats[name]
summaries[name] = getTesterSummary(testerStats)
Expand Down Expand Up @@ -142,14 +142,17 @@ func (t *LoadTest) Run(ctx context.Context) error {
}

}
fmt.Println(testerTable)

if len(names) > 0 {
fmt.Println("\nTrack loading:")
fmt.Println(testerTable)
}

if len(summaries) == 0 {
return nil
}

// tester summary
fmt.Println("\nSubscriber summaries:")
summaryTable := util.CreateTable().
Headers("Tester", "Tracks", "Bitrate", "Total Pkt. Loss", "Error").
StyleFunc(func(row, col int) lipgloss.Style {
Expand Down Expand Up @@ -178,6 +181,7 @@ func (t *LoadTest) Run(ctx context.Context) error {
)
summaryTable.Row("Total", fmt.Sprintf("%d/%d", s.tracks, s.expected), sBitrate, sDropped, string(s.errCount))
}
fmt.Println("\nSubscriber summaries:")
fmt.Println(summaryTable)

return nil
Expand Down Expand Up @@ -209,6 +213,7 @@ func (t *LoadTest) RunSuite(ctx context.Context) error {

table := util.CreateTable().
Headers("Pubs", "Subs", "Tracks", "Audio", "Video", "Pkt. Loss", "Errors")
showTrackStats := false

for _, c := range cases {
caseParams := t.Params
Expand Down Expand Up @@ -245,26 +250,34 @@ func (t *LoadTest) RunSuite(ctx context.Context) error {
errCount++
}
}
table.Row(
strconv.Itoa(c.publishers),
strconv.Itoa(c.subscribers),
strconv.FormatInt(tracks, 10),
"Yes",
videoString,
formatLossRate(packets, dropped),
strconv.FormatInt(errCount, 10),
)
if tracks > 0 {
showTrackStats = true
table.Row(
strconv.Itoa(c.publishers),
strconv.Itoa(c.subscribers),
strconv.FormatInt(tracks, 10),
"Yes",
videoString,
formatLossRate(packets, dropped),
strconv.FormatInt(errCount, 10),
)
}
}

fmt.Println(table)
if showTrackStats {
fmt.Println("\nSuite results:")
fmt.Println(table)
}
return nil
}

func (t *LoadTest) run(ctx context.Context, params Params) (map[string]*testerStats, error) {
if params.Room == "" {
params.Room = fmt.Sprintf("testroom%d", rand.Int31n(1000))
}
params.IdentityPrefix = randStringRunes(5)
if params.IdentityPrefix == "" {
params.IdentityPrefix = randStringRunes(5)
}

expectedTracks := params.VideoPublishers + params.AudioPublishers

Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
package livekitcli

const (
Version = "2.3.0"
Version = "2.3.1"
)

0 comments on commit 97b5c86

Please sign in to comment.