https://github.com/bewaremypower/pulsar-client-cpp-perf
The performance tool for the Pulsar C++ client.
https://github.com/bewaremypower/pulsar-client-cpp-perf
Last synced: 10 months ago
JSON representation
The performance tool for the Pulsar C++ client.
- Host: GitHub
- URL: https://github.com/bewaremypower/pulsar-client-cpp-perf
- Owner: BewareMyPower
- Created: 2023-08-23T08:25:30.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-11T14:46:41.000Z (over 2 years ago)
- Last Synced: 2025-03-03T13:45:26.489Z (over 1 year ago)
- Language: C++
- Size: 30.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pulsar-client-cpp-perf
The **independent** performance tool for the Pulsar C++ client.
Though you can also build the tool in the [official repository](https://github.com/apache/pulsar-client-cpp/tree/main/perf), this project don't require you to build the Pulsar C++ client library from source. You can install the client library from the pre-built binanry first, see [here](https://pulsar.apache.org/docs/3.1.x/client-libraries-cpp-setup/) for more details.
## Requirements
- A C++ compiler that supports C++11, like GCC >= 4.8
- CMake >= 3.1
- Boost (with the `program_options` component)
## Build
First, clone this repo with all submodules.
```bash
git clone https://github.com/BewareMyPower/pulsar-client-cpp-perf.git
git submodule update --init --recursive
```
Then, build the tool with vcpkg.
```bash
cd pulsar-client-cpp-perf
# CMAKE_BUILD_TYPE is required for now, there is a bug in pulsar-client-cpp's port
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
```
Run `./build/perfProducer` for how to use it. For example, the following command run a producer against a Pulsar broker that listens on 6650 port locally with the following configs:
- Send 100000 messages per second, each message is 1 KiB by default.
- The batch size is 1000.
- The batch timeout is 1ms.
```bash
./build/perfProducer --service-url pulsar://localhost:6650 \
--rate 100000 \
--batch-size=1000 \
--max-batch-publish-delay-in-ms=1 \
my-topic
```
## Verify the version
Modify [vcpkg.json](./vcpkg.json) to test another version of `pulsar-client-cpp`.
> **Note**:
>
> Currently only 3.4.2 is available in vcpkg.