|
| 1 | +# Apache Kafka benchmark operator |
| 2 | + |
| 3 | +The Apache Kafka benchmark charm uses the [OpenMessaging](https://github.com/openmessaging/benchmark) tool to test both producer and consumer performance in the cluster. |
| 4 | + |
| 5 | +The OpenMessaging allows for a distributed deployment, where the charm leader will run the main "manager" process and gather the metrics, whilst other units will act as followers and act as producer/consumers of the cluster. |
| 6 | + |
| 7 | +## Usage |
| 8 | + |
| 9 | + |
| 10 | +Create a new Juju model: |
| 11 | + |
| 12 | +``` |
| 13 | +juju add-model kafka-benchmark |
| 14 | +``` |
| 15 | + |
| 16 | +Deploy Apache Kafka with Juju: |
| 17 | + |
| 18 | +``` |
| 19 | +juju deploy kafka --channel=3/edge |
| 20 | +juju deploy zookeeper --channel=3/edge |
| 21 | +juju relate kafka zookeeper |
| 22 | +``` |
| 23 | + |
| 24 | +Deploy the benchmark tool and relate it to the cluster: |
| 25 | + |
| 26 | +``` |
| 27 | +juju deploy kafka-benchmark --channel=latest/edge |
| 28 | +juju relate kafka kafka-benchmark |
| 29 | +``` |
| 30 | + |
| 31 | +### Benchmarking |
| 32 | + |
| 33 | +To kick start a benchmark, execute the following actions: |
| 34 | + |
| 35 | +``` |
| 36 | +juju run kafka-benchmark/leader prepare # to set the environment and the cluster |
| 37 | +juju run kafka-benchmark/leader run |
| 38 | +``` |
| 39 | + |
| 40 | +The units will pick-up the command and start executing the benchmark. |
| 41 | + |
| 42 | +### Stop benchmarking |
| 43 | + |
| 44 | +To stop the benchmark, execute: |
| 45 | + |
| 46 | +``` |
| 47 | +juju run kafka-benchmark/leader stop |
| 48 | +``` |
| 49 | + |
| 50 | +Optionally, it is possible to clean the current benchmark data using: |
| 51 | + |
| 52 | +``` |
| 53 | +juju run kafka-benchmark/leader cleanup |
| 54 | +``` |
| 55 | + |
| 56 | +That will return both Apache Kafka benchmark charm and Apache Kafka cluster to their original condition. |
| 57 | + |
| 58 | +### COS integration |
| 59 | + |
| 60 | +Relate the Apache Kafka benchmark with a [`grafana-agent` operator](https://charmhub.io/grafana-agent). |
| 61 | + |
| 62 | +For more details on how to deploy and configure COS and its agents, check [the upstream documentation](https://canonical.com/data/docs/kafka/iaas/h-enable-monitoring). |
| 63 | + |
| 64 | +Once the `grafana-agent` is deployed, relate it with: |
| 65 | + |
| 66 | +``` |
| 67 | +juju relate grafana-agent kafka-benchmark |
| 68 | +``` |
| 69 | + |
| 70 | +The benchmark data will be collected every 10s and sent to prometheus. |
| 71 | + |
| 72 | + |
| 73 | +## Contributing |
| 74 | + |
| 75 | +Please see the [Juju SDK docs](https://juju.is/docs/sdk) for guidelines on enhancements to this charm following best practice guidelines, and [CONTRIBUTING.md](https://github.com/canonical/kafka-benchmark-operator/blob/main/CONTRIBUTING.md) for developer guidance. |
| 76 | + |
| 77 | +Also, if you truly enjoy working on open-source projects like this one, check out the [career options](https://canonical.com/careers/all) we have at [Canonical](https://canonical.com/). |
| 78 | + |
| 79 | +## License |
| 80 | + |
| 81 | +Apache Kafka benchmark operator is free software, distributed under the Apache Software License, version 2.0. See [LICENSE](https://github.com/canonical/kafka-benchmark-operator/blob/main/LICENSE) for more information. |
0 commit comments