java - How to monitor application processing of Kafka messages for load testing -
there application (not mine) reads messages kafka, processing on them, , stores records in database. i've put program in java writes messages queue @ given rate. right now, simple measure of performance querying database @ end of test run ensure records in = records out. however, i'd expand periodically check queue see how many messages pending application hasn't yet processed see if it's getting backed up.
i figure can check offset of application's group id in zookeeper. looked @ kafka documentation, gives basic consumer examples , api documentation sparse @ best, i'm not sure how go finding information.
what apis need call in order find out in queue application at, , how many messages in queue behind position?
i'm using kafka 2.10-0.8.2.1 single zookeeper instance , 3 kafka instances, , load tester using 0.8.2.1 java api. topic in question has 3 partitions (one on each kafka server), purpose of test there single consumer.
i suggest looking @ provided tools in kafka (code available in src if need call api directly). in particular,
$ bin/kafka-run-class.sh kafka.tools.consumeroffsetchecker --group consumer-group1 --zkconnect zkhost:zkport --topic topic1
will show offset , lag:
consumer-group1,topic1,0-0 (group,topic,brokerid-partitionid) owner = consumer-group1-consumer1 consumer offset = 70121994703 = 70,121,994,703 (65.31g) log size = 70122018287 = 70,122,018,287 (65.31g) consumer lag = 23584 = 23,584 (0.00g)
references:
Comments
Post a Comment