-
Notifications
You must be signed in to change notification settings - Fork 4k
Add command and REST endpoint to list stream tracking info #9642
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
Conversation
8598c3b
to
4b8a442
Compare
Acceptance StepsGet the branch and start the broker: cd /tmp
git clone [email protected]:rabbitmq/rabbitmq-server.git
cd rabbitmq-server
git checkout stream-list-tracking-info
make run-broker PLUGINS="rabbitmq_stream_management" Open another tab in wget https://github.com/rabbitmq/rabbitmq-java-tools-binaries-dev/releases/download/v-stream-perf-test-latest/stream-perf-test-latest.jar Once the broker is started, get the tracking info for a stream that does not exist: sbin/rabbitmq-streams list_stream_tracking stream Expected output:
Run the performance tool to create the stream: java -jar stream-perf-test-latest.jar --rate 1000 --time 5 Get the tracking info: sbin/rabbitmq-streams list_stream_tracking stream Expected output (no tracking info yet):
Run a consumer that does some offset tracking: java -jar stream-perf-test-latest.jar --rate 1000 --time 5 --consumer-names consumer-1 --store-every 100 Get the tracking info: sbin/rabbitmq-streams list_stream_tracking stream Expected output (
Run a consumer with another name: java -jar stream-perf-test-latest.jar --rate 1000 --time 5 --consumer-names consumer-2 --store-every 100 Get the tracking info: sbin/rabbitmq-streams list_stream_tracking stream Expected output, there should be 2 lines:
Run a producer with deduplication: java -jar stream-perf-test-latest.jar --rate 1000 --time 5 --consumer-names consumer-2 --store-every 100 --producer-names publisher-1 Get the tracking info: sbin/rabbitmq-streams list_stream_tracking stream Expected output, there should be 3 lines, one is for the producer (
Run a producer with another name: java -jar stream-perf-test-latest.jar --rate 1000 --time 5 --consumer-names consumer-2 --store-every 100 --producer-names publisher-2 Get the tracking info: sbin/rabbitmq-streams list_stream_tracking stream Expected output, there should be 4 lines, one more for the producer:
Get only the writer lines: sbin/rabbitmq-streams list_stream_tracking stream --writer Expected output:
Get only the consumer lines: sbin/rabbitmq-streams list_stream_tracking stream --offset Expected output:
Get both (that's the default): sbin/rabbitmq-streams list_stream_tracking stream --all Expected output:
Wrong type: sbin/rabbitmq-streams list_stream_tracking stream --foo Expected output:
REST endpoint: curl -s -u guest:guest http://localhost:15672/api/stream/%2F/stream/tracking | jq . Expected output (the actual offset/sequence values do not matter, only the names do): {
"writers": {
"publisher-1": 4997,
"publisher-2": 5017
},
"offsets": {
"consumer-1": 7613,
"consumer-2": 22775
}
} Only the producers: curl -s -u guest:guest http://localhost:15672/api/stream/%2F/stream/tracking?type=writer | jq . Expected output: {
"writers": {
"publisher-1": 4997,
"publisher-2": 5017
}
} Only the consumers: curl -s -u guest:guest http://localhost:15672/api/stream/%2F/stream/tracking?type=offset | jq . Expected output: {
"offsets": {
"consumer-1": 7613,
"consumer-2": 22775
}
} |
Correct output when there is no line, fix usage, formatting.
b840632
to
65d381e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.