Skip to content

Conversation

@rdhabalia
Copy link
Contributor

Motivation

Add pending-queue size metrics to producer stats to create monitoring at client side and monitor various scenarios : timeout, high latency, memory, etc..

Modification

Add API ProducerStats::getPendingQueueSize to retrieve pending-queue size metrics for a producer.

@rdhabalia rdhabalia added this to the 2.10.0 milestone Nov 8, 2021
@rdhabalia rdhabalia self-assigned this Nov 8, 2021
@github-actions
Copy link

github-actions bot commented Nov 8, 2021

@rdhabalia:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

Lgtm

ProducerBuilder<byte[]> producerBuilder = pulsarClient.newProducer()
.topic("persistent://my-property/tp1/my-ns/my-topic1");

Producer<byte[]> producer = producerBuilder.enableBatching(false).create();
Copy link
Contributor

Choose a reason for hiding this comment

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

What about adding @cleanup ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test closes pulsarClient after every test method, which will also close and clean up producers/consumers. However, I just added the cleanup annotation.

PulsarAdminTool.setAllowSystemExit(false);
PulsarAdminTool.main(new String[0]);
assertEquals(PulsarAdminTool.getLastExitCode(), 1);
assertEquals(PulsarAdminTool.getLastExitCode(), 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

This change looks unrelated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it was for testing. created a separate PR: #12675

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

@rdhabalia rdhabalia merged commit ffccd46 into apache:master Nov 9, 2021
eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request Nov 29, 2021
…che#12674)

* [pulsar-client] add pending-queue size metrics to producer stats

* fix test
@Anonymitaet Anonymitaet added doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. and removed doc-label-missing labels Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/client doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants