Skip to content

Commit

Permalink
Merge branch 'release-0.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
eiiches committed Jul 23, 2020
2 parents b64ce3f + 8a89150 commit 422ece9
Show file tree
Hide file tree
Showing 90 changed files with 3,845 additions and 1,153 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
/dependency-reduced-pom.xml
/target/
/.classpath
/.settings
/.project
/pom.xml.releaseBackup
/release.properties
438 changes: 280 additions & 158 deletions README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions examples/benchmark-kafka/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/jmx_prometheus_javaagent-0.13.0.jar
/kafka-2_0_0.yml
24 changes: 24 additions & 0 deletions examples/benchmark-kafka/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
benchmark-kafka
===============

1. Start containers

```sh
./download.sh
docker-compose up
```

2. Verify setup

```sh
curl http://localhost:9639/metrics # scriptable-jmx-exporter
curl http://localhost:9404/metrics # jmx_exporter
```

3. Apply load

```sh
CONTAINER_IP=$(docker inspect benchmark-kafka_kafka_1 -f '{{ with (index .NetworkSettings.Networks "benchmark-kafka_default") }}{{ .IPAddress }}{{ end }}')
for i in {0..9}; do wrk -d 10 -t `nproc` -c `nproc` "http://$CONTAINER_IP:9639/metrics"; done
for i in {0..9}; do wrk -d 10 -t `nproc` -c `nproc` "http://$CONTAINER_IP:9404/metrics"; done
```
61 changes: 61 additions & 0 deletions examples/benchmark-kafka/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: '3.8'

services:
zookeeper:
image: 'docker.io/bitnami/zookeeper:3-debian-10'
ports:
- '2181:2181'
volumes:
- 'zookeeper_data:/bitnami'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
image: 'docker.io/bitnami/kafka:2-debian-10'
ports:
- '9092:9092'
- '9639:9639'
- '9404:9404'
volumes:
- 'kafka_data:/bitnami'
- type: bind
source: ../../target/scriptable-jmx-exporter-0.0.6-SNAPSHOT.jar
target: /opt/java-agents/scriptable-jmx-exporter.jar
- type: bind
source: ./jmx_prometheus_javaagent-0.13.0.jar
target: /opt/java-agents/jmx-exporter.jar
- type: bind
source: ./scriptable-jmx-exporter.yaml
target: /etc/scriptable-jmx-exporter.yaml
- type: bind
source: ./kafka-2_0_0.yml
target: /etc/jmx-exporter.yaml
# - type: bind
# source: ./perf-map-agent/out/attach-main.jar
# target: /attach-main.jar
# - type: bind
# source: ./perf-map-agent/out/libperfmap.so
# target: /libperfmap.so
- type: bind
source: ./perf-map.sh
target: /perf-map.sh
environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_HEAP_OPTS=-Xmx1g -Xms1g
- |
KAFKA_OPTS=
-javaagent:/opt/java-agents/scriptable-jmx-exporter.jar=@/etc/scriptable-jmx-exporter.yaml
-javaagent:/opt/java-agents/jmx-exporter.jar=9404:/etc/jmx-exporter.yaml
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=7019
# -XX:+PreserveFramePointer
# -Djava.rmi.server.hostname=172.19.0.3
depends_on:
- zookeeper

volumes:
zookeeper_data:
driver: local
kafka_data:
driver: local
5 changes: 5 additions & 0 deletions examples/benchmark-kafka/download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euo pipefail

curl -LO https://raw.githubusercontent.com/prometheus/jmx_exporter/ce04b7dca8615d724d8f447fa25c44ae1c29238b/example_configs/kafka-2_0_0.yml
curl -LO https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.13.0/jmx_prometheus_javaagent-0.13.0.jar
6 changes: 6 additions & 0 deletions examples/benchmark-kafka/perf-map.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

rm -f /tmp/perf-1.map
java -cp /attach-main.jar net.virtualvoid.perf.AttachOnce 1
sed -i 's/;::/::/g' /tmp/perf-1.map
cat /tmp/perf-1.map
22 changes: 22 additions & 0 deletions examples/benchmark-kafka/scriptable-jmx-exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
rules:
- pattern:
- com.sun.management:type=HotSpotDiagnostic:DiagnosticOptions
- java.lang:type=Threading:AllThreadIds
- jdk.management.jfr
skip: true
- pattern:
- 'kafka.*::MeanRate|.*MinuteRate' # can be calculated using rate()
- 'kafka.*::RateUnit|LatencyUnit' # unsupported type
- 'kafka.server:type=app-info:commit-id|version' # reports wrong type
skip: true
- pattern: 'kafka.*::Value'
transform: |
!java
V1.transform(in, out, "type", "name", V1.gauge(), V1.snakeCase());
- pattern: 'kafka.*'
transform: |
!java
V1.transform(in, out, "type", "name", V1.snakeCase());
- transform: |
!java
V1.transform(in, out, "type", V1.snakeCase());
Loading

0 comments on commit 422ece9

Please sign in to comment.