Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Performance test improvements #384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
emasab wants to merge 16 commits into master
base: master
Choose a base branch
Loading
from dev_performance_test_improvements

Conversation

@emasab
Copy link
Contributor

@emasab emasab commented Oct 8, 2025
edited
Loading

measure eachBatch rate, time and lag, avg and max memory usage

@emasab emasab requested review from a team as code owners October 8, 2025 12:35
@Copilot Copilot AI review requested due to automatic review settings October 8, 2025 12:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances performance testing capabilities by adding detailed metrics collection including eachBatch processing, memory usage tracking, timing measurements, and offset lag monitoring. The changes consolidate common consumer functionality and expand test coverage to include both eachMessage and eachBatch consumption patterns.

Key changes:

  • Extracted common consumer logic into a shared module supporting both eachMessage and eachBatch patterns
  • Added comprehensive memory tracking with RSS measurements during test execution
  • Enhanced metrics collection including offset lag, processing time, and batch statistics
  • Migrated performance test script from Bash to Node.js for better cross-platform compatibility

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
examples/performance/performance-primitives-common.js New shared module implementing consumer logic for both eachMessage and eachBatch patterns with enhanced metrics
examples/performance/performance-primitives.js Refactored to use common consumer module with compatibility wrapper
examples/performance/performance-primitives-kafkajs.js Updated to use common consumer module and added duration logging
examples/performance/performance-consolidated.js Added memory tracking, expanded test coverage for both consumption patterns, and enhanced logging
ci/tests/run_perf_test.sh Removed Bash-based performance test script
ci/tests/run_perf_test.js New Node.js-based performance test script with enhanced metric extraction
.semaphore/semaphore.yml Updated to use Node.js performance test script

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 47 to 46
const outputConfluentProducerConsumer = runCommand('MODE=confluent MESSAGE_COUNT=50000 node performance-consolidated.js --create-topics --consumer --producer');

console.log('Running KafkaJS Producer/Consumer test...');
const outputKjsProducerConsumer = runCommand('MODE=kafkajs MESSAGE_COUNT=50000 node performance-consolidated.js --create-topics --consumer --producer');
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message count has been reduced from 500000 to 50000 compared to the original bash script. This significant reduction (90%) may affect the reliability of performance measurements and should be documented or reconsidered.

Suggested change
const outputConfluentProducerConsumer = runCommand('MODE=confluent MESSAGE_COUNT=50000 node performance-consolidated.js --create-topics --consumer --producer');
console.log('Running KafkaJS Producer/Consumer test...');
const outputKjsProducerConsumer = runCommand('MODE=kafkajs MESSAGE_COUNT=50000 node performance-consolidated.js --create-topics --consumer --producer');
const outputConfluentProducerConsumer = runCommand('MODE=confluent MESSAGE_COUNT=500000 node performance-consolidated.js --create-topics --consumer --producer');
console.log('Running KafkaJS Producer/Consumer test...');
const outputKjsProducerConsumer = runCommand('MODE=kafkajs MESSAGE_COUNT=500000 node performance-consolidated.js --create-topics --consumer --producer');

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it makes the test faster with bigger messages sizes and doesn't seem to affect reliability of results.

@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_performance_test_improvements branch 2 times, most recently from 99bbb70 to 7cd3c3f Compare October 8, 2025 15:11
@emasab emasab changed the title (削除) Performance test improvements, measure eachBatch rate, time and lag, avg and max memory usage (削除ここまで) (追記) Performance test improvements (追記ここまで) Oct 8, 2025

This comment has been minimized.

1 similar comment

This comment has been minimized.

Copy link
Contributor

@milindl milindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the new features to the test (the rss) and eachBatch. The run on semaphore also looks fine to me, as expected in terms of consume throughput and rss.

Copy link
Contributor

@milindl milindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes suggested

ret = {
...ret,
ssl: parameters.securityProtocol.toLowerCase().includes('ssl'),
sasl: {
Copy link
Contributor

@milindl milindl Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing it here, at a later point, do

if (parameters.securityProtocol.toLowerCase().includes('sasl')) {
 ret['sasl'] = { ... };
}

So we can have just ssl. And above && condition can be changed also

Copy link
Contributor

@milindl milindl Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the confluent performance primitives.

This comment has been minimized.

4 similar comments

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_performance_test_improvements branch 14 times, most recently from f2d1c71 to 1e7236e Compare October 15, 2025 13:14
@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_performance_test_improvements branch 2 times, most recently from 6a53af2 to e999d4d Compare October 16, 2025 08:52

This comment has been minimized.

1 similar comment

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

1 similar comment

This comment has been minimized.

@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_performance_test_improvements branch 2 times, most recently from 15928f1 to 4209743 Compare October 17, 2025 10:29

This comment has been minimized.

Copy link

Passed

Analysis Details

10 Issues

Coverage and Duplications

  • Coverage No coverage information (48.20% Estimated after merge)
  • Duplications No duplication information (2.00% Estimated after merge)

Project ID: confluent-kafka-javascript

View in SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@milindl milindl milindl approved these changes

Copilot code review Copilot Copilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /