Skip to content
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

[fix]fix output of histogram #700

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/ylt/metric/histogram.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class histogram_t : public metric_t {
for (size_t i = 0; i < bucket_counts.size(); i++) {
auto counter = bucket_counts[i];
value_str.append(name_).append("_bucket{");
build_label_string(str, sum_->labels_name(), labels_value);
build_label_string(value_str, sum_->labels_name(), labels_value);
value_str.append(",");

if (i == bucket_boundaries_.size()) {
Expand Down
5 changes: 5 additions & 0 deletions src/metric/tests/test_metric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,11 @@ TEST_CASE("test get metric by static labels and label") {

h1->observe({"GET", "/"}, 23);

std::string str1;
h1->serialize(str1);
std::cout << str1;
CHECK(str1.find("method=\"GET\",url=\"/\",le=") != std::string::npos);

auto s1 = metric_mgr::create_metric_static<summary_t>(
"http_req_static_summary", "help",
summary_t::Quantiles{
Expand Down
Loading