20 #ifndef RIPPLE_BASICS_PERFLOGIMP_H
21 #define RIPPLE_BASICS_PERFLOGIMP_H
23 #include <ripple/basics/PerfLog.h>
24 #include <ripple/basics/chrono.h>
25 #include <ripple/beast/utility/Journal.h>
26 #include <ripple/core/Stoppable.h>
27 #include <ripple/protocol/jss.h>
28 #include <ripple/rpc/impl/Handler.h>
29 #include <boost/asio/ip/host_name.hpp>
166 rpcEnd(method, requestId,
true);
172 rpcEnd(method, requestId,
false);
182 int instance)
override;
217 #endif // RIPPLE_BASICS_PERFLOGIMP_H
std::chrono::microseconds microseconds
microseconds runningDuration
system_time_point lastLog_
Json::Value countersJson() const override
Render performance counters in Json.
void jobFinish(JobType const type, microseconds dur, int instance) override
Log job finishing.
void rotate() override
Rotate perf log file.
std::condition_variable cond_
PerfLogImp(Setup const &setup, Stoppable &parent, beast::Journal journal, std::function< void()> &&signalStop)
Singleton class that maintains performance counters and optionally writes Json-formatted data to a di...
Implementation class for PerfLog.
std::unordered_map< std::uint64_t, MethodStart > methods_
const std::string hostname_
Configuration from [perf] section of rippled.cfg.
void jobStart(JobType const type, microseconds dur, steady_time_point startTime, int instance) override
Log job executing.
Json::Value currentJson() const override
Render currently executing jobs and RPC calls and durations in Json.
Provides an interface for starting and stopping.
void onStop() override
Override called when the stop notification is issued.
A box coupling data with a mutex for locking access to it.
std::vector< std::pair< JobType, steady_time_point > > jobs_
std::unordered_map< JobType, Locked< Jq > > jq_
static JobTypes const & instance()
A generic endpoint for log messages.
const std::function< void()> signalStop_
std::unordered_map< std::string, Locked< Rpc > > rpc_
Job Queue task performance counters.
microseconds queuedDuration
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::chrono::time_point< steady_clock > steady_time_point
RPC performance counters.
void rpcEnd(std::string const &method, std::uint64_t const requestId, bool finish)
void rpcStart(std::string const &method, std::uint64_t const requestId) override
Log start of RPC call.
Json::Value currentJson() const
Track performance counters and currently executing tasks.
Locked(Locked const &rhs)
void onChildrenStopped() override
Override called when all children have stopped.
void rpcFinish(std::string const &method, std::uint64_t const requestId) override
Log successful finish of RPC call.
Counters(std::vector< char const * > const &labels, JobTypes const &jobTypes)
std::vector< char const * > getHandlerNames()
Return names of all methods.
void jobQueue(JobType const type) override
Log queued job.
void onStart() override
Override called during start.
void resizeJobs(int const resize) override
Ensure enough room to store each currently executing job.
Json::Value countersJson() const
void rpcError(std::string const &method, std::uint64_t const requestId) override
Log errored RPC call.