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

Print warp client no. in detailed analysis #148

Merged
merged 1 commit into from
Nov 19, 2020
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
3 changes: 3 additions & 0 deletions cli/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ func printAnalysis(ctx *cli.Context, o bench.Operations) {
if ops.Hosts > 1 {
hostsString = fmt.Sprintf(" Hosts: %d.", ops.Hosts)
}
if ops.Clients > 1 {
hostsString = fmt.Sprintf("%s Warp Instances: %d.", hostsString, ops.Clients)
}
if opo > 1 {
if details {
console.Printf("Operation: %v (%d). Objects per operation: %d. Concurrency: %d.%s\n", typ, ops.N, opo, ops.Concurrency, hostsString)
Expand Down
3 changes: 3 additions & 0 deletions pkg/aggregate/aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ type Operation struct {
ObjectsPerOperation int `json:"objects_per_operation"`
// Concurrency - total number of threads running.
Concurrency int `json:"concurrency"`
// Number of warp clients.
Clients int `json:"clients"`
// Numbers of hosts
Hosts int `json:"hosts"`
// Populated if requests are all of same object size.
Expand Down Expand Up @@ -184,6 +186,7 @@ func Aggregate(o bench.Operations, dFn SegmentDurFn, skipDur time.Duration) Aggr
a.Throughput.Segmented.fill(segs, total)
a.ObjectsPerOperation = ops.FirstObjPerOp()
a.Concurrency = ops.Threads()
a.Clients = ops.Clients()
a.Hosts = ops.Hosts()

if !ops.MultipleSizes() {
Expand Down
12 changes: 12 additions & 0 deletions pkg/bench/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,18 @@ func (o Operations) Hosts() int {
return len(endpoints)
}

// Clients returns the number of clients.
func (o Operations) Clients() int {
if len(o) == 0 {
return 0
}
clients := make(map[string]struct{}, 10)
for _, op := range o {
clients[op.ClientID] = struct{}{}
}
return len(clients)
}

// Endpoints returns the endpoints as a sorted slice.
func (o Operations) Endpoints() []string {
if len(o) == 0 {
Expand Down