-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Unit tests push telemetry encode decode #4440
Conversation
7ec933e
to
3a91abe
Compare
3a91abe
to
1f93898
Compare
There was a problem hiding this 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
src/rdkafka_telemetry_decode.c
Outdated
return status; | ||
} | ||
|
||
void clear_unit_test_data() { |
There was a problem hiding this comment.
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
src/rdkafka_telemetry_decode.c
Outdated
unit_test_data.metric_time = 0; | ||
} | ||
|
||
bool unit_test_telemetry_gauge() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool unit_test_telemetry_gauge() { | |
bool unit_test_telemetry_gauge(void) { |
minor
src/rdkafka_telemetry_decode.c
Outdated
RD_UT_PASS(); | ||
} | ||
|
||
bool unit_test_telemetry_sum() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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(); |
There was a problem hiding this comment.
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
src/rdkafka_telemetry_decode.c
Outdated
uint64_t metric_time; | ||
}; | ||
|
||
struct metric_unit_test_data unit_test_data; |
There was a problem hiding this comment.
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.
f5f7521
to
243a4c4
Compare
When do you plan to have KIP 714 working? Is there a roadmap published somewhere? |
@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. |
No description provided.