22
33A throughput benchmark for the Cloud Pub/Sub Rust client library.
44
5- This tool measures the performance of publishing messages to a Google Cloud Pub/Sub topic, or receiving messages from a subscription. It reports operation rates in messages per second and megabytes per second.
5+ This tool measures the performance of publishing messages to a Google Cloud
6+ Pub/Sub topic, or receiving messages from a subscription. It reports operation
7+ rates in messages per second and megabytes per second.
68
79## Usage
810
@@ -12,48 +14,55 @@ cargo run --release -p pubsub-throughput -- [COMMAND] [OPTIONS]
1214
1315### Commands
1416
15- * ` publisher ` : Measure publishing throughput.
16- * ` subscriber ` : Measure subscribing throughput.
17+ - ` publisher ` : Measure publishing throughput.
18+ - ` subscriber ` : Measure subscribing throughput.
1719
1820### Common Options (Global)
1921
20- * ` --project ` : The Google Cloud project ID.
21- * ` --report-interval ` : The interval between progress reports (e.g., ` 5s ` , ` 1m ` ; default: ` 5s ` ).
22- * ` --duration ` : The total duration to run the benchmark (e.g., ` 5m ` , ` 1h ` ; default: ` 5m ` ).
23- * ` --grpc-channels ` : The number of gRPC channels to use (default: ` 1 ` ).
24- * ` --max-outstanding-messages ` : The maximum number of unacknowledged messages held in memory (default: ` 100000 ` ).
22+ - ` --project ` : The Google Cloud project ID.
23+ - ` --report-interval ` : The interval between progress reports (e.g., ` 5s ` , ` 1m ` ;
24+ default: ` 5s ` ).
25+ - ` --duration ` : The total duration to run the benchmark (e.g., ` 5m ` , ` 1h ` ;
26+ default: ` 5m ` ).
27+ - ` --grpc-channels ` : The number of gRPC channels to use (default: ` 1 ` ).
28+ - ` --max-outstanding-messages ` : The maximum number of unacknowledged messages
29+ held in memory (default: ` 100000 ` ).
2530
2631### Publisher Options
2732
28- * ` --topic-id ` : The ID of the Pub/Sub topic to publish to (Required).
29- * ` --payload-size ` : The size of each message payload in bytes (default: ` 1024 ` ).
30- * ` --batch-size ` : The maximum number of messages in a batch (default: ` 1000 ` ).
31- * ` --batch-bytes ` : The maximum size of a batch in bytes (default: ` 10485760 ` which is 10 MB).
32- * ` --batch-delay ` : The maximum time to wait before sending a batch (default: ` 100ms ` ).
33+ - ` --topic-id ` : The ID of the Pub/Sub topic to publish to (Required).
34+ - ` --payload-size ` : The size of each message payload in bytes (default: ` 1024 ` ).
35+ - ` --batch-size ` : The maximum number of messages in a batch (default: ` 1000 ` ).
36+ - ` --batch-bytes ` : The maximum size of a batch in bytes (default: ` 10485760 `
37+ which is 10 MB).
38+ - ` --batch-delay ` : The maximum time to wait before sending a batch (default:
39+ ` 100ms ` ).
3340
3441### Subscriber Options
3542
36- * ` --subscription-id ` : The ID of the Pub/Sub subscription to receive from (Required).
37- * ` --streams ` : The number of subscriber streams to run (default: ` 1 ` ).
43+ - ` --subscription-id ` : The ID of the Pub/Sub subscription to receive from
44+ (Required).
45+ - ` --streams ` : The number of subscriber streams to run (default: ` 1 ` ).
3846
3947## Output Format
4048
4149The benchmark outputs data in CSV format with the following columns:
4250
43- * ` timestamp ` : The Unix timestamp in milliseconds.
44- * ` elapsed(s) ` : The elapsed time for the operation in seconds.
45- * ` op ` : The operation being measured (` Pub ` , ` Ack ` , or ` Recv ` ).
46- * ` iteration ` : The current iteration number.
47- * ` count ` : The number of messages processed in the operation.
48- * ` msgs/s ` : The number of messages per second.
49- * ` bytes ` : The total number of bytes processed.
50- * ` MB/s ` : The throughput in megabytes per second.
51- * ` errors ` : The number of errors encountered (if any).
52- * ` errors/s ` : The number of errors per second (if any).
51+ - ` timestamp ` : The Unix timestamp in milliseconds.
52+ - ` elapsed(s) ` : The elapsed time for the operation in seconds.
53+ - ` op ` : The operation being measured (` Pub ` , ` Ack ` , or ` Recv ` ).
54+ - ` iteration ` : The current iteration number.
55+ - ` count ` : The number of messages processed in the operation.
56+ - ` msgs/s ` : The number of messages per second.
57+ - ` bytes ` : The total number of bytes processed.
58+ - ` MB/s ` : The throughput in megabytes per second.
59+ - ` errors ` : The number of errors encountered (if any).
60+ - ` errors/s ` : The number of errors per second (if any).
5361
5462## Examples
5563
5664### Publisher Run
65+
5766``` bash
5867cargo run --release -p pubsub-throughput -- publisher \
5968 --project my-gcp-project \
@@ -64,6 +73,7 @@ cargo run --release -p pubsub-throughput -- publisher \
6473```
6574
6675### Subscriber Run
76+
6777``` bash
6878cargo run --release -p pubsub-throughput -- subscriber \
6979 --project my-gcp-project \
0 commit comments