20 #include <ripple/core/impl/Workers.h>
21 #include <ripple/beast/unit_test.h>
22 #include <ripple/basics/PerfLog.h>
23 #include <ripple/core/JobTypes.h>
24 #include <ripple/json/json_value.h>
58 int instance)
override
62 int instance)
override
110 std::make_unique<perf::PerfLogTest>();
115 auto testForThreadCount = [
this, &cb, &w] (
int const threadCount)
118 cb.
count = threadCount;
124 for (
int i = 0; i < threadCount; ++i)
129 using namespace std::chrono_literals;
131 bool const signaled = cb.
cv.
wait_for(lk, 10s, [&cb]{
return cb.
count == 0;});
132 BEAST_EXPECT(signaled);
133 BEAST_EXPECT(cb.
count == 0);
135 testForThreadCount (tc1);
136 testForThreadCount (tc2);
137 testForThreadCount (tc3);
141 BEAST_EXPECT(cb.
count == 0);
BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, ripple)
void resizeJobs(int const resize) override
Ensure enough room to store each currently executing job.
void testThreads(int const tc1, int const tc2, int const tc3)
int getNumberOfThreads() const noexcept
Retrieve the desired number of threads.
void rpcError(std::string const &method, std::uint64_t dur) override
Log errored RPC call.
void jobFinish(JobType const type, std::chrono::microseconds dur, int instance) override
Log job finishing.
void setNumberOfThreads(int numberOfThreads)
Set the desired number of threads.
Singleton class that maintains performance counters and optionally writes Json-formatted data to a di...
void jobStart(JobType const type, std::chrono::microseconds dur, std::chrono::time_point< std::chrono::steady_clock > startTime, int instance) override
Called to perform tasks as needed.
void processTask(int instance) override
Perform a task.
std::condition_variable cv
Json::Value countersJson() const override
Render performance counters in Json.
void pauseAllThreadsAndWait()
Pause all threads and wait until they are paused.
A group of threads that process tasks.
Json::Value currentJson() const override
Render currently executing jobs and RPC calls and durations in Json.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void rotate() override
Rotate perf log file.
void addTask()
Add a task to be performed.
void jobQueue(JobType const type) override
Log queued job.
void rpcFinish(std::string const &method, std::uint64_t requestId) override
Log successful finish of RPC call.
void rpcStart(std::string const &method, std::uint64_t requestId) override
Log start of RPC call.