Skip to content

Commit

Permalink
Display object sizes with --analyze.v (#242)
Browse files Browse the repository at this point in the history
Examples:

```
Operation: PUT - total: 228971, 15.0%, Size: 250000 bytes, Concurrency: 24, Ran 14m59s, starting 2022-12-13 19:48:23.673 +0530 +0530

Throughput by host:
 * http://minio-site1-db1:9000: Avg: 20.28 MiB/s, 85.04 obj/s.
...
```

```
Operation: PUT (19517). Ran 2m0s. Size: 1000 bytes. Concurrency: 20. Hosts: 6.

Requests considered: 19433:
 * Avg: 123ms, 50%: 101ms, 90%: 202ms, 99%: 244ms, Fastest: 21ms, Slowest: 321ms
...
```

On multi-sized objects it is already displayed, eg:

```
Operation: PUT (2500). Ran 10s. Concurrency: 20.

Requests considered: 2409. Multiple sizes, average 1822444 bytes:

Request size 10B -> 10KiB. Requests - 349:
...
```
  • Loading branch information
klauspost authored Jan 12, 2023
1 parent 4dbdeda commit 68c4111
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions cli/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,15 @@ func printMixedOpAnalysis(ctx *cli.Context, aggr aggregate.Aggregated, details b
pct = 100.0 * float64(ops.Throughput.Operations) / float64(aggr.MixedServerStats.Operations)
}
duration := ops.EndTime.Sub(ops.StartTime).Truncate(time.Second)
if !details {

if !details || ops.Skipped {
console.Printf("Operation: %v, %d%%, Concurrency: %d, Ran %v.\n", ops.Type, int(pct+0.5), ops.Concurrency, duration)
} else {
console.Printf("Operation: %v - total: %v, %.01f%%, Concurrency: %d, Ran %v, starting %v\n", ops.Type, ops.Throughput.Operations, pct, ops.Concurrency, duration, ops.StartTime.Truncate(time.Millisecond))
sz := ""
if ops.SingleSizedRequests != nil && ops.SingleSizedRequests.ObjSize > 0 {
sz = fmt.Sprintf("Size: %d bytes. ", ops.SingleSizedRequests.ObjSize)
}
console.Printf("Operation: %v - total: %v, %.01f%%, %vConcurrency: %d, Ran %v, starting %v\n", ops.Type, ops.Throughput.Operations, pct, sz, ops.Concurrency, duration, ops.StartTime.Truncate(time.Millisecond))
}
console.SetColor("Print", color.New(color.FgWhite))

Expand Down Expand Up @@ -307,15 +312,19 @@ func printAnalysis(ctx *cli.Context, o bench.Operations) {
hostsString = fmt.Sprintf("%s Warp Instances: %d.", hostsString, ops.Clients)
}
ran := ops.EndTime.Sub(ops.StartTime).Truncate(time.Second)
sz := ""
if ops.SingleSizedRequests != nil && ops.SingleSizedRequests.ObjSize > 0 {
sz = fmt.Sprintf("Size: %d bytes. ", ops.SingleSizedRequests.ObjSize)
}
if opo > 1 {
if details {
console.Printf("Operation: %v (%d). Ran %v. Objects per operation: %d. Concurrency: %d.%s\n", typ, ops.N, ran, opo, ops.Concurrency, hostsString)
if details && ops.Concurrency > 0 {
console.Printf("Operation: %v (%d). Ran %v. Objects per operation: %d. %vConcurrency: %d.%s\n", typ, ops.N, ran, opo, sz, ops.Concurrency, hostsString)
} else {
console.Printf("Operation: %v\n", typ)
}
} else {
if details {
console.Printf("Operation: %v (%d). Ran %v. Concurrency: %d.%s\n", typ, ops.N, ran, ops.Concurrency, hostsString)
if details && ops.Concurrency > 0 {
console.Printf("Operation: %v (%d). Ran %v. %vConcurrency: %d.%s\n", typ, ops.N, ran, sz, ops.Concurrency, hostsString)
} else {
console.Printf("Operation: %v\n", typ)
}
Expand Down

0 comments on commit 68c4111

Please sign in to comment.