Skip to content

Commit fda414c

Browse files
committed
cc docs: clarify ownership of buckets in utils::statistics::Histogram docs
commit_hash:30d7bba541c38616138679f4d2551d7fe5dbf827
1 parent 3af9991 commit fda414c

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

core/include/userver/utils/statistics/histogram.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ struct BoundsBlock;
6262
/// @snippet utils/statistics/histogram_test.cpp metric tag
6363
class Histogram final {
6464
public:
65-
/// Sets upper bounds for each non-"infinite" bucket. The lowest bound is
65+
/// @brief Sets upper bounds for each non-"infinite" bucket. The lowest bound is
6666
/// always 0.
67+
///
68+
/// @param upper_bounds is copied inside and is not required to be kept alive after the constructor completes.
6769
explicit Histogram(utils::span<const double> upper_bounds);
6870

6971
/// Copies an existing histogram.

core/include/userver/utils/statistics/histogram_aggregator.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#pragma once
22

3+
/// @file userver/utils/statistics/histogram_aggregator.hpp
4+
/// @brief @copybrief utils::statistics::HistogramAggregator
5+
36
#include <memory>
47

58
#include <userver/utils/span.hpp>
69
#include <userver/utils/statistics/fwd.hpp>
710
#include <userver/utils/statistics/histogram_view.hpp>
811

9-
/// @file userver/utils/statistics/histogram_aggregator.hpp
10-
/// @brief @copybrief utils::statistics::HistogramAggregator
11-
1212
USERVER_NAMESPACE_BEGIN
1313

1414
namespace utils::statistics {
@@ -19,6 +19,10 @@ namespace utils::statistics {
1919
/// @snippet utils/statistics/histogram_test.cpp HistogramAggregator
2020
class HistogramAggregator final {
2121
public:
22+
/// @brief Sets upper bounds for each non-"infinite" bucket. The lowest bound is
23+
/// always 0.
24+
///
25+
/// @param upper_bounds is copied inside and is not required to be kept alive after the constructor completes.
2226
explicit HistogramAggregator(utils::span<const double> upper_bounds);
2327

2428
HistogramAggregator(HistogramAggregator&&) noexcept;

core/src/utils/statistics/histogram_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ UTEST(StatisticsHistogram, Sample) {
9191
/// [sample]
9292
utils::statistics::Storage storage;
9393

94-
utils::statistics::Histogram histogram{std::vector<double>{1.5, 5, 42, 60}};
94+
utils::statistics::Histogram histogram{{1.5, 5, 42, 60}};
9595

9696
auto statistics_holder =
9797
storage.RegisterWriter("test", [&](utils::statistics::Writer& writer) { writer = histogram; });

0 commit comments

Comments
 (0)