20 #include <ripple/basics/PerfLog.h>
21 #include <ripple/beast/unit_test.h>
22 #include <ripple/core/JobTypes.h>
23 #include <ripple/core/impl/Workers.h>
24 #include <ripple/json/json_value.h>
67 int instance)
override
131 std::make_unique<perf::PerfLogTest>();
136 auto testForThreadCount = [
this, &cb, &w](
int const threadCount) {
138 cb.
count = threadCount;
144 for (
int i = 0; i < threadCount; ++i)
149 using namespace std::chrono_literals;
151 bool const signaled =
153 BEAST_EXPECT(signaled);
154 BEAST_EXPECT(cb.
count == 0);
156 testForThreadCount(tc1);
157 testForThreadCount(tc2);
158 testForThreadCount(tc3);
162 BEAST_EXPECT(cb.
count == 0);
BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, ripple)
void stop()
Pause all threads and wait until they are paused.
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.
Workers is effectively a thread pool.
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.