1#include <xrpl/basics/MallocTrim.h>
3#include <boost/predef.h>
5#include <gtest/gtest.h>
11#if defined(__GLIBC__) && BOOST_OS_LINUX
34 EXPECT_EQ(report.
deltaKB(), -200);
39 EXPECT_EQ(report.
deltaKB(), 100);
47#if defined(__GLIBC__) && BOOST_OS_LINUX
48TEST(parseStatmRSSkB, standard_format)
50 using xrpl::detail::parseStatmRSSkB;
55 std::string const statm =
"25365 1000 2377 0 0 5623 0";
56 long const result = parseStatmRSSkB(statm);
64 std::string const statm =
"12345 2000 1234 0 0 3456 0\n";
65 long const result = parseStatmRSSkB(statm);
71 std::string const statm =
"12345\t2000\t1234\t0\t0\t3456\t0";
72 long const result = parseStatmRSSkB(statm);
78 std::string const statm =
"25365 0 2377 0 0 5623 0";
79 long const result = parseStatmRSSkB(statm);
86 long const result = parseStatmRSSkB(statm);
93 long const result = parseStatmRSSkB(statm);
94 EXPECT_EQ(result, -1);
100 long const result = parseStatmRSSkB(statm);
101 EXPECT_EQ(result, -1);
107 long const result = parseStatmRSSkB(statm);
108 EXPECT_EQ(result, -1);
114 long const result = parseStatmRSSkB(statm);
115 EXPECT_EQ(result, -1);
126#if defined(__GLIBC__) && BOOST_OS_LINUX
148#if defined(__GLIBC__) && BOOST_OS_LINUX
178#if defined(__GLIBC__) && BOOST_OS_LINUX
198 for (
int i = 0; i < 5; ++i)
202#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