3#include <xrpld/rpc/detail/Handler.h>
5#include <xrpl/beast/unit_test.h>
21 return (os << ns.
count() <<
"ns");
38 double sum_squared = 0;
44 for (
auto& i : inputs)
64 sum_squared += (samples[k] * samples[k]);
68 double const mean_squared = (
sum *
sum) / (j * j);
70 clock::duration{
static_cast<long>(
sum / j)},
72 static_cast<long>(
std::sqrt((sum_squared / j) - mean_squared))},
79 testcase(
"Handler lookup performance");
90 auto const [mean, stdev, n] =
time(
94 dummy = dummy + i + (int)d->role_;
98 std::cout <<
"mean=" << mean <<
" stdev=" << stdev <<
" N=" << n
101 BEAST_EXPECT(dummy != 0);
testcase_t testcase
Memberspace for declaring test cases.
auto time(std::size_t n, auto f, auto prng) -> auto
void run() override
Runs the suite.
void reportLookupPerformance()
Set the expected result code for a JTx The test will fail if the code doesn't match.
std::set< char const * > getHandlerNames()
Return names of all methods.
Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
auto make_vector(Input const &input)
std::ostream & operator<<(std::ostream &os, PrettyAmount const &amount)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static auto sum(TCollection const &col)