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

Fix uperf RR reporting #146

Merged
merged 1 commit into from
Jun 24, 2024
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
4 changes: 2 additions & 2 deletions cmd/k8s-netperf/k8s-netperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func executeWorkload(nc config.Config, s config.PerfScenarios, hostNet bool, dri
if err != nil {
log.Fatal(err)
}
nr, err = driver.ParseResults(&r)
nr, err = driver.ParseResults(&r, nc)
if err != nil {
log.Error(err)
try := 0
Expand All @@ -377,7 +377,7 @@ func executeWorkload(nc config.Config, s config.PerfScenarios, hostNet bool, dri
log.Error(err)
continue
}
nr, err = driver.ParseResults(&r)
nr, err = driver.ParseResults(&r, nc)
if err != nil {
log.Error(err)
try++
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
type Driver interface {
IsTestSupported(string) bool
Run(c *kubernetes.Clientset, rc rest.Config, nc config.Config, client apiv1.PodList, serverIP string) (bytes.Buffer, error)
ParseResults(stdout *bytes.Buffer) (sample.Sample, error)
ParseResults(stdout *bytes.Buffer, nc config.Config) (sample.Sample, error)
}

type netperf struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/iperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (i *iperf3) Run(c *kubernetes.Clientset, rc rest.Config, nc config.Config,

// ParseResults accepts the stdout from the execution of the benchmark.
// It will return a Sample struct or error
func (i *iperf3) ParseResults(stdout *bytes.Buffer) (sample.Sample, error) {
func (i *iperf3) ParseResults(stdout *bytes.Buffer, _ config.Config) (sample.Sample, error) {
sample := sample.Sample{}
sample.Driver = i.driverName
result := IperfResult{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/netperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (n *netperf) Run(c *kubernetes.Clientset, rc rest.Config, nc config.Config,

// ParseResults accepts the stdout from the execution of the benchmark. It also needs
// It will return a Sample struct or error
func (n *netperf) ParseResults(stdout *bytes.Buffer) (sample.Sample, error) {
func (n *netperf) ParseResults(stdout *bytes.Buffer, _ config.Config) (sample.Sample, error) {
sample := sample.Sample{}
sample.Driver = n.driverName
send := 0.0
Expand Down
11 changes: 7 additions & 4 deletions pkg/drivers/uperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (u *uperf) Run(c *kubernetes.Clientset, rc rest.Config, nc config.Config, c

// ParseResults accepts the stdout from the execution of the benchmark.
// It will return a Sample struct or error
func (u *uperf) ParseResults(stdout *bytes.Buffer) (sample.Sample, error) {
func (u *uperf) ParseResults(stdout *bytes.Buffer, nc config.Config) (sample.Sample, error) {
sample := sample.Sample{}
sample.Driver = u.driverName
sample.Metric = "Mb/s"
Expand Down Expand Up @@ -218,10 +218,13 @@ func (u *uperf) ParseResults(stdout *bytes.Buffer) (sample.Sample, error) {

}
averageByte, _ := stats.Mean(byteSummary)
averageOps, _ := stats.Mean(opSummary)
sample.Throughput = float64(averageByte*8) / 1000000
if strings.Contains(nc.Profile, "STREAM") {
sample.Throughput = float64(averageByte*8) / 1000000
} else {
sample.Throughput, _ = stats.Mean(opSummary)
}
sample.Latency99ptile, _ = stats.Percentile(latSummary, 99)
log.Debugf("Storing uperf sample throughput: %f Mbps, P99 Latency %f, Average ops: %f ", sample.Throughput, sample.Latency99ptile, averageOps)
log.Debugf("Storing uperf sample Average bytes: %f , P99 Latency %f, Throughput: %f ", averageByte, sample.Latency99ptile, sample.Throughput)

return sample, nil

Expand Down
Loading