@@ -50,9 +50,9 @@ struct comparator {
5050 }
5151};
5252
53- static inline uint64_t timespec_to_uint64 (const timespec &stamp)
53+ static inline uint64_t timespec_to_uint64 (timespec &stamp)
5454{
55- return ( stamp.tv_sec * 1000000000ULL ) + stamp.tv_nsec ;
55+ return stamp.tv_sec * 1000000000ULL + stamp.tv_nsec ;
5656}
5757
5858class Metric
@@ -293,7 +293,7 @@ class Histogram final : public Metric
293293 out << name_snake ({" count" }, add_labels) << ' ' << _sketch.get_n () << std::endl;
294294 }
295295
296- void to_opentelemetry (metrics::v1::ScopeMetrics &scope, timespec &start, [[maybe_unused]] timespec &end, LabelMap add_labels = {}) const
296+ void to_opentelemetry (metrics::v1::ScopeMetrics &scope, timespec &start, timespec &end, LabelMap add_labels = {}) const
297297 {
298298 if (_sketch.is_empty ()) {
299299 return ;
@@ -316,7 +316,7 @@ class Histogram final : public Metric
316316 m_hist->set_aggregation_temporality (metrics::v1::AggregationTemporality::AGGREGATION_TEMPORALITY_CUMULATIVE);
317317 auto hist_data_point = m_hist->add_data_points ();
318318 hist_data_point->set_start_time_unix_nano (timespec_to_uint64 (start));
319- // hist_data_point->set_time_unix_nano(timespec_to_uint64(end));
319+ hist_data_point->set_time_unix_nano (timespec_to_uint64 (end));
320320
321321 for (std::size_t i = 0 ; i < bins.size (); ++i) {
322322 hist_data_point->add_explicit_bounds (bins[i] - pace);
@@ -448,7 +448,7 @@ class Quantile final : public Metric
448448 }
449449 }
450450
451- void to_opentelemetry (metrics::v1::ScopeMetrics &scope, timespec &start, [[maybe_unused]] timespec &end, LabelMap add_labels = {}) const override
451+ void to_opentelemetry (metrics::v1::ScopeMetrics &scope, timespec &start, timespec &end, LabelMap add_labels = {}) const override
452452 {
453453 if (_quantile.is_empty ()) {
454454 return ;
@@ -467,7 +467,7 @@ class Quantile final : public Metric
467467 metric->set_description (_desc);
468468 auto summary_data_point = metric->mutable_summary ()->add_data_points ();
469469 summary_data_point->set_start_time_unix_nano (timespec_to_uint64 (start));
470- // summary_data_point->set_time_unix_nano(timespec_to_uint64(end));
470+ summary_data_point->set_time_unix_nano (timespec_to_uint64 (end));
471471 for (auto it = quantiles.begin (); it != quantiles.end (); ++it) {
472472 auto quantile = summary_data_point->add_quantile_values ();
473473 quantile->set_quantile (fractions[it - quantiles.begin ()]);
@@ -521,11 +521,11 @@ class TopN final : public Metric
521521 return quantile.get_quantile (_percentile_threshold);
522522 }
523523
524- void _set_opentelemetry_data (opentelemetry::proto::metrics::v1::NumberDataPoint *data_point, uint64_t start, [[maybe_unused]] uint64_t end, const Metric::LabelMap &l, uint64_t value) const
524+ void _set_opentelemetry_data (opentelemetry::proto::metrics::v1::NumberDataPoint *data_point, uint64_t start, uint64_t end, const Metric::LabelMap &l, uint64_t value) const
525525 {
526526 data_point->set_as_int (value);
527527 data_point->set_start_time_unix_nano (start);
528- // data_point->set_time_unix_nano(end);
528+ data_point->set_time_unix_nano (end);
529529 for (const auto &label : l) {
530530 auto attribute = data_point->add_attributes ();
531531 attribute->set_key (label.first );
0 commit comments