Skip to content

Commit 8472ddb

Browse files
committed
cleanup
1 parent 0d56601 commit 8472ddb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/common/metrics_foo_library/foo_library.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <stdint.h>
55
#include <stdlib.h>
66
#include <chrono>
7+
#include <cmath>
78
#include <map>
89
#include <thread>
910
#include <utility>
@@ -168,9 +169,10 @@ void foo_library::semconv_histogram_example()
168169
for (uint32_t i = 0; i < 20; ++i)
169170
{
170171
double val = (rand() % 700) + 1.1;
172+
uint64_t int_val = std::llround(val);
171173
std::map<std::string, std::string> labels = get_random_attr();
172174
auto labelkv = opentelemetry::common::KeyValueIterableView<decltype(labels)>{labels};
173-
histogram_counter->Record(val, labelkv, context);
175+
histogram_counter->Record(int_val, labelkv, context);
174176
std::this_thread::sleep_for(std::chrono::milliseconds(250));
175177
}
176178
}

0 commit comments

Comments
 (0)