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>
176 rpcEnd(method, requestId,
true);
182 rpcEnd(method, requestId,
false);
192 int instance)
override;
233 #endif // RIPPLE_BASICS_PERFLOGIMP_H
std::chrono::microseconds microseconds
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.
std::unordered_map< std::string, Rpc > rpc_
void onPrepare() override
Override called during preparation.
Provides an interface for starting and stopping.
void onStop() override
Override called when the stop notification is issued.
std::vector< std::pair< JobType, steady_time_point > > jobs_
static JobTypes const & instance()
std::unordered_map< std::underlying_type_t< JobType >, Jq > jq_
A generic endpoint for log messages.
const std::function< void()> signalStop_
Job Queue task performance counters.
microseconds runningDuration
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)
Jq(std::string const &labelArg)
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.
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.
microseconds queuedDuration