diff options
author | Sergey Polovko <sergey@polovko.me> | 2022-02-10 16:47:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:03 +0300 |
commit | 2e714b5ebd40a1f4cc31c27f1ad6e49ca6d895f5 (patch) | |
tree | b83306b6e37edeea782e9eed673d89286c4fef35 /library/cpp/histogram/hdr/histogram_iter.cpp | |
parent | 3e0b762a82514bac89c1dd6ea7211e381d8aa248 (diff) | |
download | ydb-2e714b5ebd40a1f4cc31c27f1ad6e49ca6d895f5.tar.gz |
Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/histogram/hdr/histogram_iter.cpp')
-rw-r--r-- | library/cpp/histogram/hdr/histogram_iter.cpp | 292 |
1 files changed, 146 insertions, 146 deletions
diff --git a/library/cpp/histogram/hdr/histogram_iter.cpp b/library/cpp/histogram/hdr/histogram_iter.cpp index 4975348e22..d251fd5dd9 100644 --- a/library/cpp/histogram/hdr/histogram_iter.cpp +++ b/library/cpp/histogram/hdr/histogram_iter.cpp @@ -1,146 +1,146 @@ -#include "histogram_iter.h" - -#include <contrib/libs/hdr_histogram/src/hdr_histogram.h> - -namespace NHdr { - // TBaseHistogramIterator ----------------------------------------------------- - TBaseHistogramIterator::TBaseHistogramIterator() - : Iter_(new hdr_iter) - { - } - - TBaseHistogramIterator::~TBaseHistogramIterator() { - } - - bool TBaseHistogramIterator::Next() { - return hdr_iter_next(Iter_.Get()); - } - - i32 TBaseHistogramIterator::GetCountsIndex() const { - return Iter_->counts_index; - } - - i32 TBaseHistogramIterator::GetTotalCount() const { - return Iter_->total_count; - } - - i64 TBaseHistogramIterator::GetCount() const { - return Iter_->count; - } - - i64 TBaseHistogramIterator::GetCumulativeCount() const { - return Iter_->cumulative_count; - } - - i64 TBaseHistogramIterator::GetValue() const { - return Iter_->value; - } - - i64 TBaseHistogramIterator::GetHighestEquivalentValue() const { - return Iter_->highest_equivalent_value; - } - - i64 TBaseHistogramIterator::GetLowestEquivalentValue() const { - return Iter_->lowest_equivalent_value; - } - - i64 TBaseHistogramIterator::GetMedianEquivalentValue() const { - return Iter_->median_equivalent_value; - } - - i64 TBaseHistogramIterator::GetValueIteratedFrom() const { - return Iter_->value_iterated_from; - } - - i64 TBaseHistogramIterator::GetValueIteratedTo() const { - return Iter_->value_iterated_to; - } - - // TAllValuesIterator --------------------------------------------------------- - - TAllValuesIterator::TAllValuesIterator(const THistogram& histogram) { - hdr_iter_init(Iter_.Get(), histogram.GetHdrHistogramImpl()); - } - - // TRecordedValuesIterator ---------------------------------------------------- - - TRecordedValuesIterator::TRecordedValuesIterator(const THistogram& histogram) { - hdr_iter_recorded_init(Iter_.Get(), histogram.GetHdrHistogramImpl()); - } - - i64 TRecordedValuesIterator::GetCountAddedInThisIterationStep() const { - return Iter_->specifics.recorded.count_added_in_this_iteration_step; - } - - // TPercentileIterator -------------------------------------------------------- - - TPercentileIterator::TPercentileIterator( - const THistogram& histogram, ui32 ticksPerHalfDistance) { - hdr_iter_percentile_init( - Iter_.Get(), histogram.GetHdrHistogramImpl(), - ticksPerHalfDistance); - } - - i32 TPercentileIterator::GetTicketsPerHalfDistance() const { - return Iter_->specifics.percentiles.ticks_per_half_distance; - } - - double TPercentileIterator::GetPercentileToIterateTo() const { - return Iter_->specifics.percentiles.percentile_to_iterate_to; - } - - double TPercentileIterator::GetPercentile() const { - return Iter_->specifics.percentiles.percentile; - } - - // TLinearIterator ------------------------------------------------------------ - - TLinearIterator::TLinearIterator( - const THistogram& histogram, i64 valueUnitsPerBucket) { - hdr_iter_linear_init( - Iter_.Get(), histogram.GetHdrHistogramImpl(), valueUnitsPerBucket); - } - - i64 TLinearIterator::GetValueUnitsPerBucket() const { - return Iter_->specifics.linear.value_units_per_bucket; - } - - i64 TLinearIterator::GetCountAddedInThisIterationStep() const { - return Iter_->specifics.linear.count_added_in_this_iteration_step; - } - - i64 TLinearIterator::GetNextValueReportingLevel() const { - return Iter_->specifics.linear.next_value_reporting_level; - } - - i64 TLinearIterator::GetNextValueReportingLevelLowestEquivalent() const { - return Iter_->specifics.linear.next_value_reporting_level_lowest_equivalent; - } - - // TLogarithmicIterator ------------------------------------------------------- - - TLogarithmicIterator::TLogarithmicIterator( - const THistogram& histogram, i64 valueUnitsInFirstBucket, - double logBase) { - hdr_iter_log_init( - Iter_.Get(), histogram.GetHdrHistogramImpl(), - valueUnitsInFirstBucket, logBase); - } - - double TLogarithmicIterator::GetLogBase() const { - return Iter_->specifics.log.log_base; - } - - i64 TLogarithmicIterator::GetCountAddedInThisIterationStep() const { - return Iter_->specifics.log.count_added_in_this_iteration_step; - } - - i64 TLogarithmicIterator::GetNextValueReportingLevel() const { - return Iter_->specifics.log.next_value_reporting_level; - } - - i64 TLogarithmicIterator::GetNextValueReportingLevelLowestEquivalent() const { - return Iter_->specifics.log.next_value_reporting_level_lowest_equivalent; - } - -} +#include "histogram_iter.h" + +#include <contrib/libs/hdr_histogram/src/hdr_histogram.h> + +namespace NHdr { + // TBaseHistogramIterator ----------------------------------------------------- + TBaseHistogramIterator::TBaseHistogramIterator() + : Iter_(new hdr_iter) + { + } + + TBaseHistogramIterator::~TBaseHistogramIterator() { + } + + bool TBaseHistogramIterator::Next() { + return hdr_iter_next(Iter_.Get()); + } + + i32 TBaseHistogramIterator::GetCountsIndex() const { + return Iter_->counts_index; + } + + i32 TBaseHistogramIterator::GetTotalCount() const { + return Iter_->total_count; + } + + i64 TBaseHistogramIterator::GetCount() const { + return Iter_->count; + } + + i64 TBaseHistogramIterator::GetCumulativeCount() const { + return Iter_->cumulative_count; + } + + i64 TBaseHistogramIterator::GetValue() const { + return Iter_->value; + } + + i64 TBaseHistogramIterator::GetHighestEquivalentValue() const { + return Iter_->highest_equivalent_value; + } + + i64 TBaseHistogramIterator::GetLowestEquivalentValue() const { + return Iter_->lowest_equivalent_value; + } + + i64 TBaseHistogramIterator::GetMedianEquivalentValue() const { + return Iter_->median_equivalent_value; + } + + i64 TBaseHistogramIterator::GetValueIteratedFrom() const { + return Iter_->value_iterated_from; + } + + i64 TBaseHistogramIterator::GetValueIteratedTo() const { + return Iter_->value_iterated_to; + } + + // TAllValuesIterator --------------------------------------------------------- + + TAllValuesIterator::TAllValuesIterator(const THistogram& histogram) { + hdr_iter_init(Iter_.Get(), histogram.GetHdrHistogramImpl()); + } + + // TRecordedValuesIterator ---------------------------------------------------- + + TRecordedValuesIterator::TRecordedValuesIterator(const THistogram& histogram) { + hdr_iter_recorded_init(Iter_.Get(), histogram.GetHdrHistogramImpl()); + } + + i64 TRecordedValuesIterator::GetCountAddedInThisIterationStep() const { + return Iter_->specifics.recorded.count_added_in_this_iteration_step; + } + + // TPercentileIterator -------------------------------------------------------- + + TPercentileIterator::TPercentileIterator( + const THistogram& histogram, ui32 ticksPerHalfDistance) { + hdr_iter_percentile_init( + Iter_.Get(), histogram.GetHdrHistogramImpl(), + ticksPerHalfDistance); + } + + i32 TPercentileIterator::GetTicketsPerHalfDistance() const { + return Iter_->specifics.percentiles.ticks_per_half_distance; + } + + double TPercentileIterator::GetPercentileToIterateTo() const { + return Iter_->specifics.percentiles.percentile_to_iterate_to; + } + + double TPercentileIterator::GetPercentile() const { + return Iter_->specifics.percentiles.percentile; + } + + // TLinearIterator ------------------------------------------------------------ + + TLinearIterator::TLinearIterator( + const THistogram& histogram, i64 valueUnitsPerBucket) { + hdr_iter_linear_init( + Iter_.Get(), histogram.GetHdrHistogramImpl(), valueUnitsPerBucket); + } + + i64 TLinearIterator::GetValueUnitsPerBucket() const { + return Iter_->specifics.linear.value_units_per_bucket; + } + + i64 TLinearIterator::GetCountAddedInThisIterationStep() const { + return Iter_->specifics.linear.count_added_in_this_iteration_step; + } + + i64 TLinearIterator::GetNextValueReportingLevel() const { + return Iter_->specifics.linear.next_value_reporting_level; + } + + i64 TLinearIterator::GetNextValueReportingLevelLowestEquivalent() const { + return Iter_->specifics.linear.next_value_reporting_level_lowest_equivalent; + } + + // TLogarithmicIterator ------------------------------------------------------- + + TLogarithmicIterator::TLogarithmicIterator( + const THistogram& histogram, i64 valueUnitsInFirstBucket, + double logBase) { + hdr_iter_log_init( + Iter_.Get(), histogram.GetHdrHistogramImpl(), + valueUnitsInFirstBucket, logBase); + } + + double TLogarithmicIterator::GetLogBase() const { + return Iter_->specifics.log.log_base; + } + + i64 TLogarithmicIterator::GetCountAddedInThisIterationStep() const { + return Iter_->specifics.log.count_added_in_this_iteration_step; + } + + i64 TLogarithmicIterator::GetNextValueReportingLevel() const { + return Iter_->specifics.log.next_value_reporting_level; + } + + i64 TLogarithmicIterator::GetNextValueReportingLevelLowestEquivalent() const { + return Iter_->specifics.log.next_value_reporting_level_lowest_equivalent; + } + +} |