Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cmd): bump version #493

Merged
merged 2 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
)
Loading