-
Notifications
You must be signed in to change notification settings - Fork 1.8k
lib: updates for cmetrics and monkey #10870
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -108,7 +108,7 @@ static inline int cat_histogram_values(struct cmt_metric *metric_dst, struct cmt | |||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| for (i = 0; i <= histogram->buckets->count; i++) { | ||||||||||||||||||
| for (i = 0; i < histogram->buckets->count; i++) { | ||||||||||||||||||
| /* histogram buckets are always integers, no need to convert them */ | ||||||||||||||||||
| metric_dst->hist_buckets[i] += metric_src->hist_buckets[i]; | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
+111
to
114
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Histogram concatenation drops the +Inf bucket.
Apply: - for (i = 0; i < histogram->buckets->count; i++) {
+ for (i = 0; i <= histogram->buckets->count; i++) {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,7 +36,7 @@ struct cmt_histogram_buckets *cmt_histogram_buckets_create_size(double *bkts, si | |||||
| } | ||||||
|
|
||||||
| /* besides buckets set by the user, we add an implicit bucket for +inf */ | ||||||
| upper_bounds = calloc(1, sizeof(double) * (count + 1)); | ||||||
| upper_bounds = calloc(1, sizeof(double) * count + 1); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix calloc under-allocation (parentheses bug). Allocates Apply one of the safe patterns (consistent with the rest of this file, upper_bounds has length = count): - upper_bounds = calloc(1, sizeof(double) * count + 1);
+ upper_bounds = calloc(count, sizeof(double));📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| if (!upper_bounds) { | ||||||
| cmt_errno(); | ||||||
| return NULL; | ||||||
|
|
||||||
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.
💡 Verification agent
🧩 Analysis chain
Always-on remote write: ensure protobuf-c is linked and propagate it; also prefer list(APPEND).
Compiling external/*.pb-c.c introduces a hard link-time dependency on protobuf-c. cmetrics-static currently doesn’t declare/propagate that, which can break final linkage with static libs due to order/transitivity.
Verification script to confirm discovery/links:
🏁 Script executed:
Length of output: 0
🏁 Script executed:
Length of output: 0
🏁 Script executed:
Length of output: 2668
Always-on remote write: link protobuf-c and switch to list(APPEND)
external/*.pb-c.c), replacefind_package(ProtobufC REQUIRED)(or your preferred discovery) before appending the.pb-c.cfiles.🤖 Prompt for AI Agents