Toolbox
snapshot
The Reactive C++ Toolbox
Loading...
Searching...
No Matches
toolbox
hdr
Utility.hpp
Go to the documentation of this file.
1
// The Reactive C++ Toolbox.
2
// Copyright (C) 2021 Reactive Markets Limited
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
#ifndef TOOLBOX_HDR_UTILITY
16
#define TOOLBOX_HDR_UTILITY
17
18
#include <
toolbox/Config.h
>
19
20
#include <cstdint>
21
#include <iosfwd>
22
23
namespace
toolbox
{
25
inline
namespace
hdr {
26
class
Histogram;
27
28
TOOLBOX_API
std::int64_t
min
(
const
Histogram& h)
noexcept
;
29
TOOLBOX_API
std::int64_t
max
(
const
Histogram& h)
noexcept
;
30
36
TOOLBOX_API
std::int64_t
value_at_percentile
(
const
Histogram& h,
double
percentile)
noexcept
;
37
42
TOOLBOX_API
double
mean
(
const
Histogram& h)
noexcept
;
43
48
TOOLBOX_API
double
stddev
(
const
Histogram& h)
noexcept
;
49
50
struct
PutPercentiles
{
51
const
Histogram
&
h
;
52
std::int32_t
ticks_per_half_distance
{5};
53
double
value_scale
{1000.0};
54
};
55
56
inline
auto
put_percentiles
(
const
Histogram
& h, std::int32_t ticks_per_half_distance,
57
double
value_scale)
noexcept
58
{
59
return
PutPercentiles
{h, ticks_per_half_distance, value_scale};
60
}
61
62
TOOLBOX_API
std::ostream&
operator<<
(std::ostream& os, PutPercentiles
pp
);
63
64
}
// namespace hdr
65
}
// namespace toolbox
66
67
#endif
// TOOLBOX_HDR_UTILITY
Config.h
TOOLBOX_API
#define TOOLBOX_API
Definition
Config.h:39
toolbox::hdr::Histogram
A High Dynamic Range (HDR) Histogram.
Definition
Histogram.hpp:64
toolbox::hdr::min
int64_t min(const Histogram &h) noexcept
Definition
Utility.cpp:41
toolbox::hdr::mean
double mean(const Histogram &h) noexcept
Definition
Utility.cpp:66
toolbox::hdr::put_percentiles
auto put_percentiles(const Histogram &h, std::int32_t ticks_per_half_distance, double value_scale) noexcept
Definition
Utility.hpp:56
toolbox::hdr::value_at_percentile
int64_t value_at_percentile(const Histogram &h, double percentile) noexcept
Definition
Utility.cpp:51
toolbox::hdr::max
int64_t max(const Histogram &h) noexcept
Definition
Utility.cpp:46
toolbox::hdr::operator<<
ostream & operator<<(ostream &os, PutPercentiles pp)
Definition
Utility.cpp:96
toolbox::hdr::stddev
double stddev(const Histogram &h) noexcept
Definition
Utility.cpp:80
toolbox::util::bind
constexpr auto bind() noexcept
Definition
Slot.hpp:92
toolbox
Definition
Benchmark.cpp:26
toolbox::hdr::PutPercentiles
Definition
Utility.hpp:50
toolbox::hdr::PutPercentiles::value_scale
double value_scale
Definition
Utility.hpp:53
toolbox::hdr::PutPercentiles::h
const Histogram & h
Definition
Utility.hpp:51
toolbox::hdr::PutPercentiles::ticks_per_half_distance
std::int32_t ticks_per_half_distance
Definition
Utility.hpp:52
Generated by
1.9.8