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 progress reporting in bench cmd #434

Merged
merged 1 commit into from
Mar 24, 2023
Merged

Conversation

cenkalti
Copy link
Member

Fix #428

cmd/bbolt/main.go Outdated Show resolved Hide resolved
cmd/bbolt/main.go Show resolved Hide resolved
cmd/bbolt/main.go Outdated Show resolved Hide resolved
cmd/bbolt/main.go Outdated Show resolved Hide resolved
cmd/bbolt/main.go Outdated Show resolved Hide resolved
cmd/bbolt/main.go Outdated Show resolved Hide resolved
@ahrtr
Copy link
Member

ahrtr commented Mar 23, 2023

cc @tjungblu

}
completed, taken := r.CompletedOps(), t.Sub(lastTime)
fmt.Fprintf(w, "Completed %d requests, %d/s \n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if you want to track this with a log file on every line individually, but for the sake of console spam, maybe add a CR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @tjungblu . I couldn't understand your comment. The aim of this CR is to enable reporting progress on console while the benchmark is running. Can you elaborate a bit more on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, then why print a line for each instead of using a carriage return to have the progress report in a single line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it now. Thanks for explaining.

Copy link
Contributor

@tjungblu tjungblu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (non-binding) and thanks for fixing it (again)

cmd/bbolt/main.go Show resolved Hide resolved
@cenkalti cenkalti force-pushed the atomic branch 2 times, most recently from 2875d71 to 54484b9 Compare March 23, 2023 20:35
@cenkalti
Copy link
Member Author

Output after latest push on this CR:

% go run ./cmd/bbolt/ bench -count 5000000
starting write benchmark.
Starting write iteration 0
Completed 1466160 requests, 1465434/s
Completed 2772700 requests, 1306436/s
Completed 4053350 requests, 1280549/s
Completed 5000000 requests, 1553296/s
Finished write iteration 0
Completed 5000000 requests, 0/s
Completed 5000000 requests, 0/s
Completed 5000000 requests, 0/s
Completed 5000000 requests, 0/s
Completed 5000000 requests, 0/s
Completed 5000000 requests, 0/s
Completed 5000000 requests, 0/s
Completed 5000000 requests, 0/s
Completed 5000000 requests, 0/s
Completed 5000000 requests, 0/s
starting read benchmark.
Completed 42853508 requests, 42819649/s
# Write 5000000(ops)    13.873989083s   (2.774µs/op)    (360490 op/sec)
# Read  45000000(ops)   1.050179107s    (23ns/op)       (43478260 op/sec)

If you feel like printing progress after write iteration done (during commit phase) is unnecessary, I can make the progress reporting stop earlier.

Signed-off-by: Cenk Alti <alticen@amazon.com>
@cenkalti
Copy link
Member Author

@ahrtr Comments addressed. Can you take another look?

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thank you @cenkalti

@ahrtr ahrtr merged commit 5a7a94e into etcd-io:master Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

bench: read: read seq: iter mismatch
4 participants