Skip to content

Unit tests push telemetry encode decode#4440

Merged
Anchit Jain (anchitj) merged 4 commits intodev_kip_714from
dev_kip_714_push_ut
Sep 29, 2023
Merged

Unit tests push telemetry encode decode#4440
Anchit Jain (anchitj) merged 4 commits intodev_kip_714from
dev_kip_714_push_ut

Conversation

@anchitj
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@milindl Milind L (milindl) left a comment

Choose a reason for hiding this comment

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

mostly looks good, a few comments.

also later on, we should remove the fprintfs and use RD_UT_SAY or something similar, but leaving that in as the function is used for debugging now

Comment thread src/rdkafka_telemetry_decode.c Outdated
return status;
}

void clear_unit_test_data() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mark these methods 'static' , everything that's used as a helper function for testing, or non-top level test functions, it's best to make static

Comment thread src/rdkafka_telemetry_decode.c Outdated
unit_test_data.metric_time = 0;
}

bool unit_test_telemetry_gauge() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
bool unit_test_telemetry_gauge() {
bool unit_test_telemetry_gauge(void) {

minor

Comment thread src/rdkafka_telemetry_decode.c Outdated
RD_UT_PASS();
}

bool unit_test_telemetry_sum() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
bool unit_test_telemetry_sum() {
bool unit_test_telemetry_sum(void) {

minor


int unittest_telemetry_decode(void) {
int fails = 0;
fails += unit_test_telemetry_gauge();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both these tests can be turned into one function with a few params, they just differ at one or two places and the rest is the same

Comment thread src/rdkafka_telemetry_decode.c Outdated
uint64_t metric_time;
};

struct metric_unit_test_data unit_test_data;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

since we use this global variable only in this file, declare it static.

@anchitj Anchit Jain (anchitj) merged commit 1216b39 into dev_kip_714 Sep 29, 2023
@anchitj Anchit Jain (anchitj) deleted the dev_kip_714_push_ut branch September 29, 2023 07:11
@dtheodor
Copy link
Copy Markdown

When do you plan to have KIP 714 working? Is there a roadmap published somewhere?

@milindl
Copy link
Copy Markdown
Contributor

Milind L (milindl) commented Oct 5, 2023

Dimitris Theodorou (@dtheodor) , KIP-714 is not yet accepted by Apache Kafka: https://cwiki.apache.org/confluence/display/KAFKA/KIP-714%3A+Client+metrics+and+observability

So, there's no roadmap yet for librdkafka. We need to wait for acceptance and for it to make it to Apache Kafka before we can put it into librdkafka.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants