1#include <xrpl/basics/MallocTrim.h>
3#include <xrpl/beast/utility/Journal.h>
5#include <boost/predef.h>
7#include <gtest/gtest.h>
15#if defined(__GLIBC__) && BOOST_OS_LINUX
18parseStatmRSSkB(std::string
const& statm);
38 EXPECT_EQ(report.
deltaKB(), -200);
43 EXPECT_EQ(report.
deltaKB(), 100);
51#if defined(__GLIBC__) && BOOST_OS_LINUX
52TEST(parseStatmRSSkB, standard_format)
54 using xrpl::detail::parseStatmRSSkB;
59 std::string const statm =
"25365 1000 2377 0 0 5623 0";
60 long const result = parseStatmRSSkB(statm);
68 std::string const statm =
"12345 2000 1234 0 0 3456 0\n";
69 long const result = parseStatmRSSkB(statm);
75 std::string const statm =
"12345\t2000\t1234\t0\t0\t3456\t0";
76 long const result = parseStatmRSSkB(statm);
82 std::string const statm =
"25365 0 2377 0 0 5623 0";
83 long const result = parseStatmRSSkB(statm);
90 long const result = parseStatmRSSkB(statm);
97 long const result = parseStatmRSSkB(statm);
98 EXPECT_EQ(result, -1);
104 long const result = parseStatmRSSkB(statm);
105 EXPECT_EQ(result, -1);
111 long const result = parseStatmRSSkB(statm);
112 EXPECT_EQ(result, -1);
118 long const result = parseStatmRSSkB(statm);
119 EXPECT_EQ(result, -1);
130#if defined(__GLIBC__) && BOOST_OS_LINUX
152#if defined(__GLIBC__) && BOOST_OS_LINUX
182#if defined(__GLIBC__) && BOOST_OS_LINUX
202 for (
int i = 0; i < 5; ++i)
206#if defined(__GLIBC__) && BOOST_OS_LINUX
Abstraction for the underlying message destination.
A generic endpoint for log messages.
static Sink & getNullSink()
Returns a Sink which does nothing.
Severity
Severity level / threshold of a Journal message.
void write(nudb::detail::ostream &os, std::size_t t)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
MallocTrimReport mallocTrim(std::string_view tag, beast::Journal journal)
Attempt to return freed memory to the operating system.
std::chrono::microseconds durationUs
std::int64_t deltaKB() const noexcept