diff --git a/AMMExtended__test_8cpp_source.html b/AMMExtended__test_8cpp_source.html
index dca8ea6914..f155f79ac6 100644
--- a/AMMExtended__test_8cpp_source.html
+++ b/AMMExtended__test_8cpp_source.html
@@ -3995,7 +3995,7 @@ $(function() {
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
-bool same(STPathSet const &st1, Args const &... args)
+bool same(STPathSet const &st1, Args const &... args)
AccountID const & ammAccount() const
Set the expected result code for a JTx The test will fail if the code doesn't match.
@@ -4070,7 +4070,7 @@ $(function() {
Sets the SendMax on a JTx.
XRPAmount reserve(jtx::Env &env, std::uint32_t count) const
void testToStrand(FeatureBitset features)
-STPath stpath(Args const &... args)
+STPath stpath(Args const &... args)
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
bool expectOffers(Env &env, AccountID const &account, std::uint16_t size, std::vector< Amounts > const &toMatch)
diff --git a/AMM__test_8cpp_source.html b/AMM__test_8cpp_source.html
index 135e67cbdd..15b6b2566b 100644
--- a/AMM__test_8cpp_source.html
+++ b/AMM__test_8cpp_source.html
@@ -4912,7 +4912,7 @@ $(function() {
-bool same(STPathSet const &st1, Args const &... args)
+bool same(STPathSet const &st1, Args const &... args)
AccountID const & ammAccount() const
Set the expected result code for a JTx The test will fail if the code doesn't match.
diff --git a/Connect_8cpp_source.html b/Connect_8cpp_source.html
index f84ad6563c..97e3453357 100644
--- a/Connect_8cpp_source.html
+++ b/Connect_8cpp_source.html
@@ -160,7 +160,7 @@ $(function() {
@ intValue
signed integer value
static Endpoint from_string(std::string const &s)
virtual Overlay & overlay()=0
-Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
+Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
Json::Value doConnect(RPC::JsonContext &context)
diff --git a/DownloadShard_8cpp_source.html b/DownloadShard_8cpp_source.html
index df5d4da6c4..1f55b19a1a 100644
--- a/DownloadShard_8cpp_source.html
+++ b/DownloadShard_8cpp_source.html
@@ -266,7 +266,7 @@ $(function() {
Handles the download and import of one or more shard archives.
-Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
+Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
diff --git a/Escrow__test_8cpp_source.html b/Escrow__test_8cpp_source.html
index af0da9b154..2414195927 100644
--- a/Escrow__test_8cpp_source.html
+++ b/Escrow__test_8cpp_source.html
@@ -1617,7 +1617,7 @@ $(function() {
Json::Value finish(AccountID const &account, AccountID const &from, std::uint32_t seq)
Set the expected result code for a JTx The test will fail if the code doesn't match.
void require(Args const &... args)
Check a set of requirements.
-Set the "FinishAfter" time tag on a JTx.
+Set the "FinishAfter" time tag on a JTx.
An immutable linear range of bytes.
void testEscrowWithTickets()
@@ -1645,11 +1645,11 @@ $(function() {
std::shared_ptr< STObject const > meta()
Return metadata for the last JTx.
Keylet escrow(AccountID const &src, std::uint32_t seq) noexcept
An escrow entry.
-
+
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
-Set the "CancelAfter" time tag on a JTx.
+Set the "CancelAfter" time tag on a JTx.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
@@ -1663,7 +1663,7 @@ $(function() {
const SF_UINT8 sfTransactionResult
NetClock::time_point now()
Returns the current network time.
-
+
const std::array< std::uint8_t, 4 > fb1
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
diff --git a/GRPCServer_8cpp_source.html b/GRPCServer_8cpp_source.html
index c54a1bc4aa..9f7cfad0aa 100644
--- a/GRPCServer_8cpp_source.html
+++ b/GRPCServer_8cpp_source.html
@@ -845,13 +845,13 @@ $(function() {
std::unique_ptr< org::xrpl::rpc::v1::XRPLedgerAPIService::Stub > getP2pForwardingStub(RPC::Context &context)
Get stub used to forward gRPC requests to a p2p node.
T find_last_of(T... args)
virtual JobQueue & getJobQueue()=0
-
+
GRPCServerImpl(Application &app)
Endpoint from_asio(boost::asio::ip::address const &address)
Convert to Endpoint.
-
+
Maps an rpc error code to its token, default message, and HTTP status.
Resource::Charge getLoadType()
@@ -875,7 +875,7 @@ $(function() {
bool shouldForwardToP2p(RPC::JsonContext &context)
Whether a request should be forwarded, based on request parameters.
-error_code_i conditionMet(Condition condition_required, T &context)
+error_code_i conditionMet(Condition condition_required, T &context)
diff --git a/GRPCServer_8h_source.html b/GRPCServer_8h_source.html
index 18a9af19ae..2debd03c5d 100644
--- a/GRPCServer_8h_source.html
+++ b/GRPCServer_8h_source.html
@@ -435,7 +435,7 @@ $(function() {
GRPCServerImpl & operator=(const GRPCServerImpl &)=delete
GRPCServerImpl(Application &app)
A generic endpoint for log messages.
-
+
Resource::Charge getLoadType()
std::optional< boost::asio::ip::tcp::endpoint > getProxiedClientEndpoint()
diff --git a/Handler_8cpp_source.html b/Handler_8cpp_source.html
index af0bca0da5..18ef11ac39 100644
--- a/Handler_8cpp_source.html
+++ b/Handler_8cpp_source.html
@@ -88,246 +88,305 @@ $(function() {
- 20 #include <ripple/rpc/handlers/Handlers.h>
- 21 #include <ripple/rpc/handlers/Version.h>
- 22 #include <ripple/rpc/impl/Handler.h>
- 23 #include <ripple/rpc/impl/RPCHelpers.h>
-
-
-
-
-
- 30 template <
typename Function>
- 31 Handler::Method<Json::Value>
- 32 byRef(Function
const & f)
-
- 34 return [f](JsonContext& context,
Json::Value & result) {
-
-
-
-
-
-
-
-
-
-
-
- 46 template <
class Object,
class HandlerImpl>
-
- 48 handle(JsonContext& context, Object&
object )
-
- 50 HandlerImpl handler(context);
-
- 52 auto status = handler.check();
-
-
-
- 56 handler.writeResult(
object );
-
-
-
- 60 Handler
const handlerArray[]{
-
-
-
- 64 {
"account_currencies" ,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 84 {
"deposit_authorized" ,
-
-
-
-
- 89 #ifdef RIPPLED_REPORTING
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 130 {
"peer_reservations_add" ,
-
-
-
- 134 {
"peer_reservations_del" ,
-
-
-
- 138 {
"peer_reservations_list" ,
-
-
-
-
- 143 {
"server_definitions" ,
-
-
-
-
-
-
-
-
-
- 153 {
"submit_multisigned" ,
-
-
-
-
-
-
-
-
- 162 {
"validation_create" ,
-
-
+ 20 #include <ripple/basics/contract.h>
+ 21 #include <ripple/rpc/handlers/Handlers.h>
+ 22 #include <ripple/rpc/handlers/Version.h>
+ 23 #include <ripple/rpc/impl/Handler.h>
+ 24 #include <ripple/rpc/impl/RPCHelpers.h>
+
+
+
+
+
+
+
+ 33 template <
typename Function>
+ 34 Handler::Method<Json::Value>
+ 35 byRef(Function
const & f)
+
+ 37 return [f](JsonContext& context,
Json::Value & result) {
+
+
+
+
+
+
+
+
+
+
+
+ 49 template <
class Object,
class HandlerImpl>
+
+ 51 handle(JsonContext& context, Object&
object )
+
+
+ 54 context.apiVersion >= HandlerImpl::minApiVer &&
+ 55 context.apiVersion <= HandlerImpl::maxApiVer);
+ 56 HandlerImpl handler(context);
+
+ 58 auto status = handler.check();
+
+
+
+ 62 handler.writeResult(
object );
+
+
+
+ 66 template <
typename HandlerImpl>
+
+
+
+
+
+ 72 &handle<Json::Value, HandlerImpl>,
+
+ 74 HandlerImpl::condition,
+ 75 HandlerImpl::minApiVer,
+ 76 HandlerImpl::maxApiVer};
+
+
+ 79 Handler
const handlerArray[]{
+
+
+
+ 83 {
"account_currencies" ,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 103 {
"deposit_authorized" ,
+
+
+
+
+ 108 #ifdef RIPPLED_REPORTING
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 149 {
"peer_reservations_add" ,
+
+
+
+ 153 {
"peer_reservations_del" ,
+
+
+
+ 157 {
"peer_reservations_list" ,
+
+
+
+
+ 162 {
"server_definitions" ,
+
+
-
- 167 {
"validator_list_sites" ,
-
-
-
-
-
-
-
-
-
-
-
-
-
- 181 template <std::
size_t N>
- 182 explicit HandlerTable(
const Handler (&entries)[N])
-
-
-
- 186 auto const & entry = entries[i];
- 187 assert(table_.find(entry.name_) == table_.end());
- 188 table_[entry.name_] = entry;
-
-
-
- 192 addHandler<LedgerHandler>();
- 193 addHandler<VersionHandler>();
-
-
-
- 197 static HandlerTable
const &
-
-
- 200 static HandlerTable
const handlerTable(handlerArray);
-
-
-
-
-
-
-
-
-
-
-
- 212 auto i = table_.find(name);
- 213 return i == table_.end() ? nullptr : &i->second;
-
-
-
-
-
-
-
- 221 for (
auto const & i : table_)
-
-
-
-
-
-
-
- 229 template <
class HandlerImpl>
-
-
-
- 233 assert(table_.find(HandlerImpl::name()) == table_.end());
+
+
+
+
+
+
+ 172 {
"submit_multisigned" ,
+
+
+
+
+
+
+
+
+ 181 {
"validation_create" ,
+
+
+
+
+ 186 {
"validator_list_sites" ,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 205 overlappingApiVersion(
+
+
+
+
+ 210 assert(minVer <= maxVer);
+
+
+
+
+
+ 216 [minVer, maxVer](
auto const & item) {
+ 217 return item.second.minApiVer_ <= maxVer &&
+ 218 item.second.maxApiVer_ >= minVer;
+
+
+
+ 222 template <std::
size_t N>
+ 223 explicit HandlerTable(
const Handler (&entries)[N])
+
+ 225 for (
auto const & entry : entries)
+
+ 227 if (overlappingApiVersion(
+
+
+
+
+
+ 233 " overlaps with an existing handler" );
-
- 236 h.name_ = HandlerImpl::name();
- 237 h.valueMethod_ = &handle<Json::Value, HandlerImpl>;
- 238 h.role_ = HandlerImpl::role();
- 239 h.condition_ = HandlerImpl::condition();
-
- 241 table_[HandlerImpl::name()] = h;
-
-
-
-
-
-
-
-
- 250 return HandlerTable::instance().getHandler(version, betaEnabled, name);
-
-
-
-
-
- 256 return HandlerTable::instance().getHandlerNames();
-
-
-
-
+ 235 table_.
insert ({entry.name_, entry});
+
+
+
+ 239 addHandler<LedgerHandler>();
+ 240 addHandler<VersionHandler>();
+
+
+
+ 244 static HandlerTable
const &
+
+
+ 247 static HandlerTable
const handlerTable(handlerArray);
+
+
+
+ 251 [[nodiscard]] Handler
const *
+
+
+
+
+
+
+
+
+
+
+ 262 range .first,
range .second, [version](
auto const & entry) {
+ 263 return entry.second.minApiVer_ <= version &&
+ 264 version <= entry.second.maxApiVer_;
+
+
+ 267 return i ==
range .second ? nullptr : &i->second;
+
+
+
+
+
+
+ 274 for (
auto const & i : table_)
+ 275 ret.
insert (i.second.name_);
+
+
+
+
+
+ 281 handler_table_t table_;
+
+ 283 template <
class HandlerImpl>
+
+
+
+ 287 static_assert(HandlerImpl::minApiVer <= HandlerImpl::maxApiVer);
+
+
+
+
+ 292 if (overlappingApiVersion(
+
+ 294 HandlerImpl::minApiVer,
+ 295 HandlerImpl::maxApiVer))
+
+
+ 298 " overlaps with an existing handler" );
+
+ 300 table_.
insert ({HandlerImpl::name, handlerFrom<HandlerImpl>()});
+
+
+
+
+
+
+
+
+ 309 return HandlerTable::instance().getHandler(version, betaEnabled, name);
+
+
+
+
+
+ 315 return HandlerTable::instance().getHandlerNames();
+
+
+
+
Json::Value doAccountNFTs(RPC::JsonContext &context)
General RPC command that can retrieve objects in the account root.
Json::Value doFeature(RPC::JsonContext &context)
@@ -345,23 +404,24 @@ $(function() {
Json::Value doAccountInfo(RPC::JsonContext &context)
Json::Value doRipplePathFind(RPC::JsonContext &)
Json::Value doSignFor(RPC::JsonContext &)
-Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
+Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
+std::set< char const * > getHandlerNames()
Return names of all methods.
+
Json::Value doAccountObjects(RPC::JsonContext &context)
-
-
+
Json::Value doServerDefinitions(RPC::JsonContext &)
Json::Value doValidators(RPC::JsonContext &)
Json::Value doValidatorListSites(RPC::JsonContext &)
Json::Value doTxReduceRelay(RPC::JsonContext &)
+
Json::Value doChannelVerify(RPC::JsonContext &)
-@ NEEDS_NETWORK_CONNECTION
+@ NEEDS_NETWORK_CONNECTION
Json::Value doPrint(RPC::JsonContext &)
Json::Value doGatewayBalances(RPC::JsonContext &context)
Json::Value doManifest(RPC::JsonContext &)
Json::Value doPeers(RPC::JsonContext &)
Json::Value doSubmitMultiSigned(RPC::JsonContext &)
constexpr unsigned int apiBetaVersion
-
Json::Value doNFTBuyOffers(RPC::JsonContext &)
Json::Value doCrawlShards(RPC::JsonContext &context)
RPC command that reports stored shards by nodes.
Json::Value doTxHistory(RPC::JsonContext &)
@@ -374,39 +434,44 @@ $(function() {
Json::Value doNFTSellOffers(RPC::JsonContext &)
Json::Value doChannelAuthorize(RPC::JsonContext &)
-
+
Json::Value doRandom(RPC::JsonContext &)
Json::Value doValidatorInfo(RPC::JsonContext &)
Json::Value doStop(RPC::JsonContext &)
Json::Value doWalletPropose(RPC::JsonContext &)
-
+
Json::Value doCanDelete(RPC::JsonContext &context)
Json::Value doConsensusInfo(RPC::JsonContext &context)
Json::Value doLedgerData(RPC::JsonContext &)
Json::Value doAccountOffers(RPC::JsonContext &context)
Json::Value doLogRotate(RPC::JsonContext &)
Json::Value doNoRippleCheck(RPC::JsonContext &)
-
-
+
+
Json::Value doLedgerClosed(RPC::JsonContext &)
+ClosedInterval< T > range(T low, T high)
Create a closed range interval.
Json::Value doBookOffers(RPC::JsonContext &context)
Json::Value doPeerReservationsList(RPC::JsonContext &)
Json::Value doAMMInfo(RPC::JsonContext &context)
Status
Return codes from Backend operations.
Json::Value doTransactionEntry(RPC::JsonContext &)
+
Json::Value doUnsubscribe(RPC::JsonContext &)
constexpr unsigned int apiMinimumSupportedVersion
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
+constexpr unsigned int apiMaximumValidVersion
Json::Value doBlackList(RPC::JsonContext &context)
+void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
Json::Value doAccountTxJson(RPC::JsonContext &context)
+
Json::Value doSign(RPC::JsonContext &)
Json::Value doPeerReservationsDel(RPC::JsonContext &)
Json::Value doTxJson(RPC::JsonContext &)
constexpr unsigned int apiMaximumSupportedVersion
Json::Value doNodeToShard(RPC::JsonContext &)
-Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
-
+
+Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
Json::Value doAccountChannels(RPC::JsonContext &context)
Json::Value doServerInfo(RPC::JsonContext &)
Json::Value doLedgerHeader(RPC::JsonContext &)
@@ -414,8 +479,8 @@ $(function() {
Json::Value doServerState(RPC::JsonContext &)
Json::Value doConnect(RPC::JsonContext &context)
Json::Value doLedgerCleaner(RPC::JsonContext &)
-std::vector< char const * > getHandlerNames()
Return names of all methods.
Json::Value doDepositAuthorized(RPC::JsonContext &context)
+
Json::Value doPeerReservationsAdd(RPC::JsonContext &)
Json::Value doBookChanges(RPC::JsonContext &context)
Json::Value doAccountLines(RPC::JsonContext &context)
diff --git a/Handler_8h_source.html b/Handler_8h_source.html
index d31a066846..acd4bb1b1e 100644
--- a/Handler_8h_source.html
+++ b/Handler_8h_source.html
@@ -96,166 +96,175 @@ $(function() {
25 #include <ripple/core/Config.h>
26 #include <ripple/rpc/RPCHandler.h>
27 #include <ripple/rpc/Status.h>
- 28 #include <ripple/rpc/impl/Tuning.h>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 48 template <
class JsonValue>
-
-
-
-
-
-
-
+ 28 #include <ripple/rpc/impl/RPCHelpers.h>
+ 29 #include <ripple/rpc/impl/Tuning.h>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 49 template <
class JsonValue>
+
+
+
+
+
+
-
-
-
- 61 template <
class Value>
-
-
-
-
-
-
- 68 result[field] = value;
-
-
-
-
-
+
+
+
+
+
+
+
+ 65 template <
class Value>
+
+
+
+
+
+
+ 72 result[field] = value;
+
+
-
-
-
-
- 80 if (context.app.config().reporting())
-
-
-
-
-
-
+
+
+
+
+
+
+
+ 84 if (context.app.config().reporting())
+
+
-
+
-
+
-
+
-
-
- 96 if (context.app.getOPs().isAmendmentBlocked() &&
-
-
-
-
-
- 102 if (context.app.getOPs().isUNLBlocked() &&
-
-
-
-
-
-
-
-
- 111 JLOG(context.j.info()) <<
"Insufficient network mode for RPC: "
- 112 << context.netOps.strOperatingMode();
-
- 114 if (context.apiVersion == 1)
-
-
-
-
- 119 if (!context.app.config().standalone() &&
-
-
- 122 if (context.ledgerMaster.getValidatedLedgerAge() >
-
-
- 125 if (context.apiVersion == 1)
-
-
-
-
- 130 auto const cID = context.ledgerMaster.getCurrentLedgerIndex();
- 131 auto const vID = context.ledgerMaster.getValidLedgerIndex();
-
-
-
- 135 JLOG(context.j.debug())
- 136 <<
"Current ledger ID(" << cID
- 137 <<
") is less than validated ledger ID(" << vID <<
")" ;
- 138 if (context.apiVersion == 1)
-
-
-
-
-
-
- 145 !context.ledgerMaster.getClosedLedger())
-
- 147 if (context.apiVersion == 1)
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ 100 if (context.app.getOPs().isAmendmentBlocked() &&
+
+
+
+
+
+ 106 if (context.app.getOPs().isUNLBlocked() &&
+
+
+
+
+
+
+
+
+ 115 JLOG(context.j.info()) <<
"Insufficient network mode for RPC: "
+ 116 << context.netOps.strOperatingMode();
+
+ 118 if (context.apiVersion == 1)
+
+
+
+
+ 123 if (!context.app.config().standalone() &&
+
+
+ 126 if (context.ledgerMaster.getValidatedLedgerAge() >
+
+
+ 129 if (context.apiVersion == 1)
+
+
+
+
+ 134 auto const cID = context.ledgerMaster.getCurrentLedgerIndex();
+ 135 auto const vID = context.ledgerMaster.getValidLedgerIndex();
+
+
+
+ 139 JLOG(context.j.debug())
+ 140 <<
"Current ledger ID(" << cID
+ 141 <<
") is less than validated ledger ID(" << vID <<
")" ;
+ 142 if (context.apiVersion == 1)
+
+
+
+
+
+
+ 149 !context.ledgerMaster.getClosedLedger())
+
+ 151 if (context.apiVersion == 1)
+
+
+
+
+
+
+
+
+
+
+
-Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
-
+Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
+std::set< char const * > getHandlerNames()
Return names of all methods.
+
-
-@ NEEDS_NETWORK_CONNECTION
+
+
+@ NEEDS_NETWORK_CONNECTION
@ SYNCING
fallen slightly behind
JSON (JavaScript Object Notation).
-
+
@ objectValue
object value (collection of name/value pairs).
-
-RPC::Condition condition_
-
+
+RPC::Condition condition_
+
-
-
+
+
Status represents the results of an operation that might fail.
+constexpr unsigned int apiMinimumSupportedVersion
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
-Method< Json::Value > valueMethod_
-error_code_i conditionMet(Condition condition_required, T &context)
+Method< Json::Value > valueMethod_
+constexpr unsigned int apiMaximumValidVersion
+error_code_i conditionMet(Condition condition_required, T &context)
Lightweight wrapper to tag static string.
-Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
+
+Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
-std::vector< char const * > getHandlerNames()
Return names of all methods.
+
Role
Indicates the level of administrative permission to grant.
constexpr auto maxValidatedLedgerAge
diff --git a/Handler__test_8cpp_source.html b/Handler__test_8cpp_source.html
new file mode 100644
index 0000000000..e4bb4a03e2
--- /dev/null
+++ b/Handler__test_8cpp_source.html
@@ -0,0 +1,246 @@
+
+
+
+
+
+
+
+rippled: Handler_test.cpp Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ rippled
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
20 #include <ripple/beast/unit_test.h>
+
21 #include <ripple/rpc/impl/Handler.h>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
39 return (os << ns.
count () <<
"ns" );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
56 double sum_squared = 0;
+
+
+
+
+
+
62 for (
auto & i : inputs)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
82 sum_squared += (samples[k] * samples[k]);
+
+
+
+
86 const double mean_squared = (
sum *
sum ) / (j * j);
+
+
88 clock::duration{
static_cast< long > (
sum / j)},
+
+
90 static_cast< long > (
std::sqrt ((sum_squared / j) - mean_squared))},
+
+
+
+
+
+
+
97 testcase(
"Handler lookup performance" );
+
+
+
+
+
+
+
+
+
+
+
108 auto const [mean, stdev, n] =
time (
+
+
+
+
112 dummy = dummy + i + (int)d->role_;
+
+
+
+
116 std::cout <<
"mean=" << mean <<
" stdev=" << stdev <<
" N=" << n
+
+
+
119 BEAST_EXPECT(dummy != 0);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+void reportLookupPerformance()
+Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
+std::set< char const * > getHandlerNames()
Return names of all methods.
+
+
+
+
+
+
+
+
+
+
+
+
+Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
+
+auto time(std::size_t n, auto f, auto prng) -> auto
+
+
+
+std::ostream & operator<<(std::ostream &os, std::chrono::nanoseconds ns)
+
+
+BEAST_DEFINE_TESTSUITE_MANUAL(AMMCalc, app, ripple)
+
+static auto sum(TCollection const &col)
+
+
+
+
+
+
diff --git a/LedgerCleanerHandler_8cpp_source.html b/LedgerCleanerHandler_8cpp_source.html
index 8da0453ba7..e44eb0715a 100644
--- a/LedgerCleanerHandler_8cpp_source.html
+++ b/LedgerCleanerHandler_8cpp_source.html
@@ -110,7 +110,7 @@ $(function() {
virtual void clean(Json::Value const ¶meters)=0
Start a long running task to clean the ledger.
virtual LedgerCleaner & getLedgerCleaner()=0
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
-Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
+Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
Json::Value doLedgerCleaner(RPC::JsonContext &)
diff --git a/LedgerHandler_8cpp_source.html b/LedgerHandler_8cpp_source.html
index ef1618610c..729ab85687 100644
--- a/LedgerHandler_8cpp_source.html
+++ b/LedgerHandler_8cpp_source.html
@@ -396,7 +396,7 @@ $(function() {
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
-
+
@@ -405,7 +405,7 @@ $(function() {
Resource::Charge & loadType
std::vector< TxDetails > getTxs() const
Returns information about all transactions currently in the queue.
-std::shared_ptr< ReadView const > ledger_
+std::shared_ptr< ReadView const > ledger_
LedgerMaster & ledgerMaster
std::pair< org::xrpl::rpc::v1::GetLedgerResponse, grpc::Status > doLedgerGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerRequest > &context)
@@ -451,13 +451,13 @@ $(function() {
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const ¶ms)
const_iterator end() const
-
+
Blob const & peekData() const
bool compare(SHAMap const &otherMap, Delta &differences, int maxCount) const
Keylet quality(Keylet const &k, std::uint64_t q) noexcept
The initial directory page for a specific quality.
-
-std::vector< TxQ::TxDetails > queueTxs_
+
+std::vector< TxQ::TxDetails > queueTxs_
const_iterator lower_bound(uint256 const &id) const
Find the object with the greatest object id smaller than the input id.
@@ -466,7 +466,7 @@ $(function() {
Status ledgerFromRequest(T &ledger, GRPCContext< R > &context)
const Charge feeHighBurdenRPC
-
+
diff --git a/LedgerHandler_8h_source.html b/LedgerHandler_8h_source.html
index 755ab9b767..88e0947b74 100644
--- a/LedgerHandler_8h_source.html
+++ b/LedgerHandler_8h_source.html
@@ -101,120 +101,117 @@ $(function() {
30 #include <ripple/rpc/Role.h>
31 #include <ripple/rpc/Status.h>
32 #include <ripple/rpc/impl/Handler.h>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 57 template <
class Object>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 93 template <
class Object>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 33 #include <ripple/rpc/impl/RPCHelpers.h>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 58 template <
class Object>
+
+
+
+ 62 static constexpr
char name [] =
"ledger" ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 86 template <
class Object>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+static constexpr unsigned minApiVer
+
-
+
+static constexpr unsigned maxApiVer
-std::shared_ptr< ReadView const > ledger_
+std::shared_ptr< ReadView const > ledger_
void copyFrom(Json::Value &to, Json::Value const &from)
Copy all the keys and values from one object into another.
-
-static Condition condition()
JSON (JavaScript Object Notation).
virtual LedgerMaster & getLedgerMaster()=0
-
-static char const * name()
+
-
+
+static constexpr Condition condition
Status represents the results of an operation that might fail.
+constexpr unsigned int apiMinimumSupportedVersion
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
LedgerHandler(JsonContext &)
-void writeResult(Object &)
+void writeResult(Object &)
LedgerEntryType
Identifiers for on-ledger objects.
+constexpr unsigned int apiMaximumValidVersion
Json::Value & addObject(Json::Value &, Json::StaticString const &key)
Add a new subobject at a named key in a Json object.
-
+
void addJson(Json::Value &json, LedgerFill const &fill)
Given a Ledger and options, fill a Json::Object or Json::Value with a description of the ledger.
-
-std::vector< TxQ::TxDetails > queueTxs_
-
+static constexpr char name[]
+
+std::vector< TxQ::TxDetails > queueTxs_
+static constexpr Role role
+
Role
Indicates the level of administrative permission to grant.
void open(soci::session &s, BasicConfig const &config, std::string const &dbName)
Open a soci session.
diff --git a/LedgerHeader__test_8cpp_source.html b/LedgerHeader__test_8cpp_source.html
new file mode 100644
index 0000000000..bc7a19e8fb
--- /dev/null
+++ b/LedgerHeader__test_8cpp_source.html
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
+rippled: LedgerHeader_test.cpp Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ rippled
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
20 #include <ripple/protocol/jss.h>
+
21 #include <test/jtx/Env.h>
+
22 #include <test/jtx/envconfig.h>
+
+
+
+
+
+
+
+
+
31 testcase(
"Current ledger" );
+
32 using namespace test::jtx;
+
33 Env env{*
this , envconfig(no_admin)};
+
+
+
36 params[jss::api_version] = 1;
+
37 params[jss::ledger_index] =
"current" ;
+
+
39 env.client().invoke(
"ledger_header" , params)[jss::result];
+
40 BEAST_EXPECT(result[jss::status] ==
"success" );
+
41 BEAST_EXPECT(result.isMember(
"ledger" ));
+
42 BEAST_EXPECT(result[jss::ledger][jss::closed] ==
false );
+
43 BEAST_EXPECT(result[jss::validated] ==
false );
+
+
+
+
+
+
49 testcase(
"Validated ledger" );
+
50 using namespace test::jtx;
+
51 Env env{*
this , envconfig(no_admin)};
+
+
+
54 params[jss::api_version] = 1;
+
55 params[jss::ledger_index] =
"validated" ;
+
+
57 env.client().invoke(
"ledger_header" , params)[jss::result];
+
58 BEAST_EXPECT(result[jss::status] ==
"success" );
+
59 BEAST_EXPECT(result.isMember(
"ledger" ));
+
60 BEAST_EXPECT(result[jss::ledger][jss::closed] ==
true );
+
61 BEAST_EXPECT(result[jss::validated] ==
true );
+
+
+
+
+
+
67 testcase(
"Command retired from API v2" );
+
68 using namespace test::jtx;
+
69 Env env{*
this , envconfig(no_admin)};
+
+
+
72 params[jss::api_version] = 2;
+
+
74 env.client().invoke(
"ledger_header" , params)[jss::result];
+
75 BEAST_EXPECT(result[jss::error] ==
"unknownCmd" );
+
76 BEAST_EXPECT(result[jss::status] ==
"error" );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, ripple)
+
+@ objectValue
object value (collection of name/value pairs).
+
+
+
+Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
+
+
+
+
+
+
diff --git a/LogRotate_8cpp_source.html b/LogRotate_8cpp_source.html
index ab15161267..eb3d024568 100644
--- a/LogRotate_8cpp_source.html
+++ b/LogRotate_8cpp_source.html
@@ -111,7 +111,7 @@ $(function() {
Json::Value doLogRotate(RPC::JsonContext &)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual void rotate()=0
Rotate perf log file.
-Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
+Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
virtual perf::PerfLog & getPerfLog()=0
diff --git a/P2pProxy_8cpp_source.html b/P2pProxy_8cpp_source.html
index e309bc6d48..ed3917c18b 100644
--- a/P2pProxy_8cpp_source.html
+++ b/P2pProxy_8cpp_source.html
@@ -158,12 +158,12 @@ $(function() {
Stream trace() const
Severity stream access functions.
Json::Value forwardToP2p(RPC::JsonContext &context) const
Forward a JSON RPC request to a randomly selected p2p node.
-Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
+Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
std::unique_ptr< org::xrpl::rpc::v1::XRPLedgerAPIService::Stub > getP2pForwardingStub() const
Randomly select a p2p node to forward a gRPC request to.
virtual ReportingETL & getReportingETL()=0
-
+
virtual Config & config()=0
ETLLoadBalancer & getETLLoadBalancer()
std::unique_ptr< org::xrpl::rpc::v1::XRPLedgerAPIService::Stub > getP2pForwardingStub(RPC::Context &context)
Get stub used to forward gRPC requests to a p2p node.
@@ -171,7 +171,7 @@ $(function() {
bool isMember(const char *key) const
Return true if the object has a member named key.
-
+
Json::Value forwardToP2p(RPC::JsonContext &context)
Forward a JSON request to a p2p node and return the response.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool shouldForwardToP2p(RPC::JsonContext &context)
Whether a request should be forwarded, based on request parameters.
diff --git a/P2pProxy_8h_source.html b/P2pProxy_8h_source.html
index 62ff79bc9c..57f9a470e2 100644
--- a/P2pProxy_8h_source.html
+++ b/P2pProxy_8h_source.html
@@ -173,13 +173,13 @@ $(function() {
bool needCurrentOrClosed(Request &request)
-
+
virtual Config & config()=0
std::unique_ptr< org::xrpl::rpc::v1::XRPLedgerAPIService::Stub > getP2pForwardingStub(RPC::Context &context)
Get stub used to forward gRPC requests to a p2p node.
-
-
+
+
Json::Value forwardToP2p(RPC::JsonContext &context)
Forward a JSON request to a p2p node and return the response.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
diff --git a/Path__test_8cpp_source.html b/Path__test_8cpp_source.html
index 02ef1d9977..54884a680a 100644
--- a/Path__test_8cpp_source.html
+++ b/Path__test_8cpp_source.html
@@ -1472,7 +1472,7 @@ $(function() {
-bool same(STPathSet const &st1, Args const &... args)
+bool same(STPathSet const &st1, Args const &... args)
const SField sfGeneric(access, 0)
Set the expected result code for a JTx The test will fail if the code doesn't match.
@@ -1533,7 +1533,7 @@ $(function() {
Sets the SendMax on a JTx.
-STPath stpath(Args const &... args)
+STPath stpath(Args const &... args)
Set Paths, SendMax on a JTx.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
diff --git a/PerfLogImp_8cpp_source.html b/PerfLogImp_8cpp_source.html
index a45567036d..69eb3dc7af 100644
--- a/PerfLogImp_8cpp_source.html
+++ b/PerfLogImp_8cpp_source.html
@@ -113,13 +113,13 @@ $(function() {
-
-
+
+
-
+
54 auto const inserted =
rpc_ .emplace(label,
Rpc ()).second;
@@ -591,7 +591,7 @@ $(function() {
-system_time_point lastLog_
+system_time_point lastLog_
@@ -604,12 +604,12 @@ $(function() {
Decorator for streaming out compact 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_
+std::condition_variable cond_
std::unique_ptr< PerfLog > make_PerfLog(PerfLog::Setup const &setup, Application &app, beast::Journal journal, std::function< void()> &&signalStop)
@@ -621,22 +621,23 @@ $(function() {
virtual void stateAccounting(Json::Value &obj)=0
-const std::string hostname_
+const std::string hostname_
virtual NetworkOPs & getOPs()=0
Configuration from [perf] section of rippled.cfg.
void jobStart(JobType const type, microseconds dur, steady_time_point startTime, int instance) override
Log job executing.
bool get_if_exists(Section const §ion, std::string const &name, T &v)
-
+
Value & append(const Value &value)
Append value to array at the end.
@ objectValue
object value (collection of name/value pairs).
-
+
std::vector< std::pair< JobType, steady_time_point > > jobs_
std::unordered_map< JobType, Locked< Jq > > jq_
+Counters(std::set< char const * > const &labels, JobTypes const &jobTypes)
bool set(T &target, std::string const &name, Section const §ion)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
@@ -644,13 +645,13 @@ $(function() {
-
+
@ current
This was a new validation and was added.
A generic endpoint for log messages.
-const std::function< void()> signalStop_
+const std::function< void()> signalStop_
std::unordered_map< std::string, Locked< Rpc > > rpc_
Job Queue task performance counters.
@@ -663,7 +664,7 @@ $(function() {
virtual NodeStore::Database & getNodeStore()=0
-
+
RPC performance counters.
@@ -677,12 +678,11 @@ $(function() {
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
-
+
-
-Counters(std::vector< char const * > const &labels, JobTypes const &jobTypes)
-
-
+
+
+
void jobQueue(JobType const type) override
Log queued job.
@@ -691,6 +691,7 @@ $(function() {
Map::size_type size() const
+
void resizeJobs(int const resize) override
Ensure enough room to store each currently executing job.
Json::Value countersJson() const
diff --git a/PerfLogImp_8h_source.html b/PerfLogImp_8h_source.html
index 35f3234747..b84d86826c 100644
--- a/PerfLogImp_8h_source.html
+++ b/PerfLogImp_8h_source.html
@@ -171,104 +171,102 @@ $(function() {
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
- 166 rpcEnd (method, requestId,
true );
-
-
-
-
-
- 172 rpcEnd (method, requestId,
false );
-
-
+
+
+
+
+
+
+ 164 rpcEnd (method, requestId,
true );
+
+
+
+
+
+ 170 rpcEnd (method, requestId,
false );
+
+
+
+
-
-
-
-
-
-
- 182 int instance)
override ;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ 180 int instance)
override ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 213 #endif // RIPPLE_BASICS_PERFLOGIMP_H
+
+
+
+
+
+
+
+
+
+
+
+
+ 211 #endif // RIPPLE_BASICS_PERFLOGIMP_H
std::chrono::microseconds microseconds
@@ -277,21 +275,22 @@ $(function() {
-system_time_point lastLog_
+system_time_point lastLog_
+std::set< char const * > getHandlerNames()
Return names of all methods.
-Json::Value countersJson() const override
Render performance counters in Json.
+Json::Value countersJson() const override
Render performance counters in Json.
PerfLogImp(Setup const &setup, Application &app, beast::Journal journal, std::function< void()> &&signalStop)
void jobFinish(JobType const type, microseconds dur, int instance) override
Log job finishing.
-
+
void rotate() override
Rotate perf log file.
-std::condition_variable cond_
+std::condition_variable cond_
Singleton class that maintains performance counters and optionally writes Json-formatted data to a di...
@@ -299,26 +298,27 @@ $(function() {
std::unordered_map< std::uint64_t, MethodStart > methods_
-const std::string hostname_
+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.
+
+Json::Value currentJson() const override
Render currently executing jobs and RPC calls and durations in Json.
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_
+Counters(std::set< char const * > const &labels, JobTypes const &jobTypes)
static JobTypes const & instance()
-
+
A generic endpoint for log messages.
-const std::function< void()> signalStop_
+const std::function< void()> signalStop_
std::unordered_map< std::string, Locked< Rpc > > rpc_
Job Queue task performance counters.
@@ -327,7 +327,7 @@ $(function() {
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)
@@ -341,23 +341,22 @@ $(function() {
Locked(Locked const &rhs)
-
-void rpcFinish(std::string const &method, std::uint64_t const requestId) override
Log successful finish of RPC call.
+
+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 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.
+void rpcError(std::string const &method, std::uint64_t const requestId) override
Log errored RPC call.
diff --git a/PerfLog__test_8cpp_source.html b/PerfLog__test_8cpp_source.html
index e71f57dbe1..b2a8b79574 100644
--- a/PerfLog__test_8cpp_source.html
+++ b/PerfLog__test_8cpp_source.html
@@ -96,1091 +96,1094 @@ $(function() {
25 #include <ripple/protocol/jss.h>
26 #include <ripple/rpc/impl/Handler.h>
27 #include <test/jtx/Env.h>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 44 using path = boost::filesystem::path;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 67 using namespace boost::filesystem;
-
-
-
-
-
-
- 74 if (!exists(dir) || !is_directory(dir) || !is_empty(dir))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 90 using namespace boost::filesystem;
- 91 return temp_directory_path() /
"perf_log_test_dir" ;
-
-
-
-
-
- 97 return logDir () /
"perf_log.txt" ;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 121 using namespace boost::filesystem;
-
-
-
-
-
-
-
-
-
-
-
-
- 134 secondSize = file_size(
path );
- 135 }
while (firstSize >= secondSize);
-
-
-
-
- 140 }
while (secondSize >= file_size(
path ));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 176 cur.isMember(jss::job) ? cur[jss::job].asString()
- 177 : cur[jss::method].asString());
-
-
-
-
-
-
-
- 185 [](
Cur const & lhs,
Cur const & rhs) {
- 186 if (lhs.dur != rhs.dur)
- 187 return (rhs.dur < lhs.dur);
- 188 return (lhs.name < rhs.name);
-
-
-
-
-
-
-
-
- 197 using namespace boost::filesystem;
-
-
-
-
- 202 BEAST_EXPECT(!exists(fixture.logFile()));
-
-
-
- 206 BEAST_EXPECT(fixture.stopSignaled ==
false );
- 207 BEAST_EXPECT(exists(fixture.logFile()));
-
-
-
-
-
-
- 214 if (!BEAST_EXPECT(!exists(fixture.logDir())))
-
-
-
-
-
-
- 221 fixture.logDir().c_str(), std::ios::out | std::ios::app);
- 222 if (!BEAST_EXPECT(nastyFile))
-
-
-
-
-
-
- 229 BEAST_EXPECT(fixture.stopSignaled ==
false );
-
- 231 BEAST_EXPECT(fixture.stopSignaled ==
true );
-
-
-
-
-
-
-
-
-
- 241 remove(fixture.logDir());
-
-
-
-
-
-
- 248 if (!BEAST_EXPECT(!exists(fixture.logDir())))
-
-
-
-
- 253 boost::system::error_code ec;
- 254 boost::filesystem::create_directories(fixture.logDir(), ec);
- 255 if (!BEAST_EXPECT(!ec))
-
-
- 258 auto fileWriteable = [](boost::filesystem::path
const & p) ->
bool {
- 259 return std::ofstream {p.c_str(), std::ios::out | std::ios::app}
-
-
-
- 263 if (!BEAST_EXPECT(fileWriteable(fixture.logFile())))
-
-
- 266 boost::filesystem::permissions(
-
- 268 perms::remove_perms | perms::owner_write | perms::others_write |
-
-
-
-
- 273 if (fileWriteable(fixture.logFile()))
-
- 275 log <<
"Unable to write protect file. Test skipped."
-
-
-
-
-
-
- 282 BEAST_EXPECT(fixture.stopSignaled ==
false );
-
- 284 BEAST_EXPECT(fixture.stopSignaled ==
true );
-
-
-
-
-
-
-
-
-
- 294 boost::filesystem::permissions(
-
- 296 perms::add_perms | perms::owner_write | perms::others_write |
-
-
-
-
-
-
-
-
-
-
- 307 auto perfLog {fixture.perfLog(withFile)};
-
-
-
-
-
-
-
-
-
-
-
- 319 ids.
reserve (labels.size() * 2);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 336 for (
int labelIndex = 0; labelIndex < labels.size(); ++labelIndex)
-
- 338 for (
int idIndex = 0; idIndex < 2; ++idIndex)
-
-
-
- 342 labels[labelIndex], ids[(labelIndex * 2) + idIndex]);
-
-
-
-
-
- 348 BEAST_EXPECT(countersJson.size() == labels.size() + 1);
- 349 for (
auto & label : labels)
-
-
-
- 353 BEAST_EXPECT(counter[jss::duration_us] ==
"0" );
- 354 BEAST_EXPECT(counter[jss::errored] ==
"0" );
- 355 BEAST_EXPECT(counter[jss::finished] ==
"0" );
- 356 BEAST_EXPECT(counter[jss::started] ==
"2" );
-
-
- 359 Json::Value const & total{countersJson[jss::total]};
- 360 BEAST_EXPECT(total[jss::duration_us] ==
"0" );
- 361 BEAST_EXPECT(total[jss::errored] ==
"0" );
- 362 BEAST_EXPECT(total[jss::finished] ==
"0" );
-
-
-
-
-
-
-
-
- 371 BEAST_EXPECT(currents.size() == labels.size() * 2);
-
-
- 374 for (
int i = 0; i < currents.size(); ++i)
-
- 376 BEAST_EXPECT(currents[i].name == labels[i / 2]);
- 377 BEAST_EXPECT(prevDur > currents[i].dur);
- 378 prevDur = currents[i].dur;
-
-
-
-
-
-
- 385 for (
int labelIndex = labels.size() - 1; labelIndex > 0; --labelIndex)
-
-
- 388 perfLog ->rpcFinish(labels[labelIndex], ids[(labelIndex * 2) + 1]);
+ 28 #include <test/jtx/TestHelpers.h>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 45 using path = boost::filesystem::path;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 68 using namespace boost::filesystem;
+
+
+
+
+
+
+ 75 if (!exists(dir) || !is_directory(dir) || !is_empty(dir))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 91 using namespace boost::filesystem;
+ 92 return temp_directory_path() /
"perf_log_test_dir" ;
+
+
+
+
+
+ 98 return logDir () /
"perf_log.txt" ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 122 using namespace boost::filesystem;
+
+
+
+
+
+
+
+
+
+
+
+
+ 135 secondSize = file_size(
path );
+ 136 }
while (firstSize >= secondSize);
+
+
+
+
+ 141 }
while (secondSize >= file_size(
path ));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 177 cur.isMember(jss::job) ? cur[jss::job].asString()
+ 178 : cur[jss::method].asString());
+
+
+
+
+
+
+
+ 186 [](
Cur const & lhs,
Cur const & rhs) {
+ 187 if (lhs.dur != rhs.dur)
+ 188 return (rhs.dur < lhs.dur);
+ 189 return (lhs.name < rhs.name);
+
+
+
+
+
+
+
+
+ 198 using namespace boost::filesystem;
+
+
+
+
+ 203 BEAST_EXPECT(!exists(fixture.logFile()));
+
+
+
+ 207 BEAST_EXPECT(fixture.stopSignaled ==
false );
+ 208 BEAST_EXPECT(exists(fixture.logFile()));
+
+
+
+
+
+
+ 215 if (!BEAST_EXPECT(!exists(fixture.logDir())))
+
+
+
+
+
+
+ 222 fixture.logDir().c_str(), std::ios::out | std::ios::app);
+ 223 if (!BEAST_EXPECT(nastyFile))
+
+
+
+
+
+
+ 230 BEAST_EXPECT(fixture.stopSignaled ==
false );
+
+ 232 BEAST_EXPECT(fixture.stopSignaled ==
true );
+
+
+
+
+
+
+
+
+
+ 242 remove(fixture.logDir());
+
+
+
+
+
+
+ 249 if (!BEAST_EXPECT(!exists(fixture.logDir())))
+
+
+
+
+ 254 boost::system::error_code ec;
+ 255 boost::filesystem::create_directories(fixture.logDir(), ec);
+ 256 if (!BEAST_EXPECT(!ec))
+
+
+ 259 auto fileWriteable = [](boost::filesystem::path
const & p) ->
bool {
+ 260 return std::ofstream {p.c_str(), std::ios::out | std::ios::app}
+
+
+
+ 264 if (!BEAST_EXPECT(fileWriteable(fixture.logFile())))
+
+
+ 267 boost::filesystem::permissions(
+
+ 269 perms::remove_perms | perms::owner_write | perms::others_write |
+
+
+
+
+ 274 if (fileWriteable(fixture.logFile()))
+
+ 276 log <<
"Unable to write protect file. Test skipped."
+
+
+
+
+
+
+ 283 BEAST_EXPECT(fixture.stopSignaled ==
false );
+
+ 285 BEAST_EXPECT(fixture.stopSignaled ==
true );
+
+
+
+
+
+
+
+
+
+ 295 boost::filesystem::permissions(
+
+ 297 perms::add_perms | perms::owner_write | perms::others_write |
+
+
+
+
+
+
+
+
+
+
+ 308 auto perfLog {fixture.perfLog(withFile)};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 338 for (
int labelIndex = 0; labelIndex < labels.
size (); ++labelIndex)
+
+ 340 for (
int idIndex = 0; idIndex < 2; ++idIndex)
+
+
+
+ 344 labels[labelIndex], ids[(labelIndex * 2) + idIndex]);
+
+
+
+
+
+ 350 BEAST_EXPECT(countersJson.size() == labels.
size () + 1);
+ 351 for (
auto & label : labels)
+
+
+
+ 355 BEAST_EXPECT(counter[jss::duration_us] ==
"0" );
+ 356 BEAST_EXPECT(counter[jss::errored] ==
"0" );
+ 357 BEAST_EXPECT(counter[jss::finished] ==
"0" );
+ 358 BEAST_EXPECT(counter[jss::started] ==
"2" );
+
+
+ 361 Json::Value const & total{countersJson[jss::total]};
+ 362 BEAST_EXPECT(total[jss::duration_us] ==
"0" );
+ 363 BEAST_EXPECT(total[jss::errored] ==
"0" );
+ 364 BEAST_EXPECT(total[jss::finished] ==
"0" );
+
+
+
+
+
+
+
+
+ 373 BEAST_EXPECT(currents.size() == labels.
size () * 2);
+
+
+ 376 for (
int i = 0; i < currents.size(); ++i)
+
+ 378 BEAST_EXPECT(currents[i].name == labels[i / 2]);
+ 379 BEAST_EXPECT(prevDur > currents[i].dur);
+ 380 prevDur = currents[i].dur;
+
+
+
+
+
+
+ 387 for (
int labelIndex = labels.
size () - 1; labelIndex > 0; --labelIndex)
+
- 390 perfLog ->rpcError(labels[labelIndex], ids[(labelIndex * 2) + 0]);
-
- 392 perfLog ->rpcFinish(labels[0], ids[0 + 1]);
-
-
- 395 auto validateFinalCounters = [
this , &labels](
-
-
- 398 Json::Value const & jobQueue = countersJson[jss::job_queue];
-
- 400 BEAST_EXPECT(jobQueue.
size () == 0);
-
-
-
- 404 BEAST_EXPECT(rpc.
size () == labels.size() + 1);
-
-
-
-
-
-
-
- 412 BEAST_EXPECT(first[jss::duration_us] !=
"0" );
- 413 BEAST_EXPECT(first[jss::errored] ==
"0" );
- 414 BEAST_EXPECT(first[jss::finished] ==
"1" );
- 415 BEAST_EXPECT(first[jss::started] ==
"2" );
-
-
-
-
- 420 for (
int i = 1; i < labels.size(); ++i)
-
-
-
-
- 425 BEAST_EXPECT(dur != 0 && dur < prevDur);
-
- 427 BEAST_EXPECT(counter[jss::errored] ==
"1" );
- 428 BEAST_EXPECT(counter[jss::finished] ==
"1" );
- 429 BEAST_EXPECT(counter[jss::started] ==
"2" );
-
-
-
-
- 434 BEAST_EXPECT(total[jss::duration_us] !=
"0" );
-
- 436 jsonToUint64 (total[jss::errored]) == labels.size() - 1);
- 437 BEAST_EXPECT(
jsonToUint64 (total[jss::finished]) == labels.size());
-
- 439 jsonToUint64 (total[jss::started]) == labels.size() * 2);
-
-
- 442 auto validateFinalCurrent = [
this ,
-
-
- 445 Json::Value const & job_queue = currentJson[jss::jobs];
- 446 BEAST_EXPECT(job_queue.
isArray ());
- 447 BEAST_EXPECT(job_queue.
size () == 0);
-
-
- 450 Json::Value const & methods = currentJson[jss::methods];
- 451 BEAST_EXPECT(methods.
size () == 1);
- 452 BEAST_EXPECT(methods.
isArray ());
-
-
- 455 BEAST_EXPECT(only.
size () == 2);
-
- 457 BEAST_EXPECT(only[jss::duration_us] !=
"0" );
- 458 BEAST_EXPECT(only[jss::method] == labels[0]);
-
-
-
- 462 validateFinalCounters(
perfLog ->countersJson());
- 463 validateFinalCurrent(
perfLog ->currentJson());
-
-
-
-
-
-
-
- 471 auto const fullPath = fixture.logFile();
+ 390 perfLog ->rpcFinish(labels[labelIndex], ids[(labelIndex * 2) + 1]);
+
+ 392 perfLog ->rpcError(labels[labelIndex], ids[(labelIndex * 2) + 0]);
+
+ 394 perfLog ->rpcFinish(labels[0], ids[0 + 1]);
+
+
+ 397 auto validateFinalCounters = [
this , &labels](
+
+
+ 400 Json::Value const & jobQueue = countersJson[jss::job_queue];
+
+ 402 BEAST_EXPECT(jobQueue.
size () == 0);
+
+
+
+ 406 BEAST_EXPECT(rpc.
size () == labels.
size () + 1);
+
+
+
+
+
+
+
+ 414 BEAST_EXPECT(first[jss::duration_us] !=
"0" );
+ 415 BEAST_EXPECT(first[jss::errored] ==
"0" );
+ 416 BEAST_EXPECT(first[jss::finished] ==
"1" );
+ 417 BEAST_EXPECT(first[jss::started] ==
"2" );
+
+
+
+
+ 422 for (
int i = 1; i < labels.
size (); ++i)
+
+
+
+
+ 427 BEAST_EXPECT(dur != 0 && dur < prevDur);
+
+ 429 BEAST_EXPECT(counter[jss::errored] ==
"1" );
+ 430 BEAST_EXPECT(counter[jss::finished] ==
"1" );
+ 431 BEAST_EXPECT(counter[jss::started] ==
"2" );
+
+
+
+
+ 436 BEAST_EXPECT(total[jss::duration_us] !=
"0" );
+
+
+
+
+
+
+
+ 444 auto validateFinalCurrent = [
this ,
+
+
+ 447 Json::Value const & job_queue = currentJson[jss::jobs];
+ 448 BEAST_EXPECT(job_queue.
isArray ());
+ 449 BEAST_EXPECT(job_queue.
size () == 0);
+
+
+ 452 Json::Value const & methods = currentJson[jss::methods];
+ 453 BEAST_EXPECT(methods.
size () == 1);
+ 454 BEAST_EXPECT(methods.
isArray ());
+
+
+ 457 BEAST_EXPECT(only.
size () == 2);
+
+ 459 BEAST_EXPECT(only[jss::duration_us] !=
"0" );
+ 460 BEAST_EXPECT(only[jss::method] == labels[0]);
+
+
+
+ 464 validateFinalCounters(
perfLog ->countersJson());
+ 465 validateFinalCurrent(
perfLog ->currentJson());
+
+
+
+
+
+
-
-
- 475 BEAST_EXPECT(!exists(fullPath));
-
-
-
-
-
-
-
-
-
-
-
-
-
- 489 lastLine = std::move(line);
-
-
-
-
-
-
-
-
-
- 499 validateFinalCounters(parsedLastLine[jss::counters]);
- 500 validateFinalCurrent(parsedLastLine[jss::current_activities]);
-
-
-
-
-
-
-
-
-
-
-
- 512 auto perfLog {fixture.perfLog(withFile)};
-
-
-
-
-
-
-
-
-
-
- 523 : type(t), typeName(std::move(name))
-
-
-
-
-
-
-
-
- 532 for (
auto const & job : jobTypes)
-
-
-
-
-
-
-
-
- 541 for (
int i = 0; i < jobs.
size (); ++i)
-
- 543 perfLog ->jobQueue(jobs[i].type);
-
- 545 perfLog ->countersJson()[jss::job_queue]};
-
- 547 BEAST_EXPECT(jq_counters.size() == i + 2);
- 548 for (
int j = 0; j <= i; ++j)
-
-
-
- 552 Json::Value const & counter{jq_counters[jobs[j].typeName]};
- 553 BEAST_EXPECT(counter.size() == 5);
- 554 BEAST_EXPECT(counter[jss::queued] ==
"1" );
- 555 BEAST_EXPECT(counter[jss::started] ==
"0" );
- 556 BEAST_EXPECT(counter[jss::finished] ==
"0" );
- 557 BEAST_EXPECT(counter[jss::queued_duration_us] ==
"0" );
- 558 BEAST_EXPECT(counter[jss::running_duration_us] ==
"0" );
-
-
-
-
- 563 BEAST_EXPECT(total.size() == 5);
- 564 BEAST_EXPECT(
jsonToUint64 (total[jss::queued]) == i + 1);
- 565 BEAST_EXPECT(total[jss::started] ==
"0" );
- 566 BEAST_EXPECT(total[jss::finished] ==
"0" );
- 567 BEAST_EXPECT(total[jss::queued_duration_us] ==
"0" );
- 568 BEAST_EXPECT(total[jss::running_duration_us] ==
"0" );
-
-
-
-
-
- 574 BEAST_EXPECT(
current .size() == 2);
- 575 BEAST_EXPECT(
current .isMember(jss::jobs));
- 576 BEAST_EXPECT(
current [jss::jobs].size() == 0);
- 577 BEAST_EXPECT(
current .isMember(jss::methods));
- 578 BEAST_EXPECT(
current [jss::methods].size() == 0);
-
-
-
-
-
-
-
-
-
-
-
- 590 for (
int i = 0; i < jobs.
size (); ++i)
-
-
- 593 jobs[i].type,
microseconds {i + 1}, steady_clock::now(), i * 2);
-
-
-
-
- 598 perfLog ->countersJson()[jss::job_queue]};
- 599 for (
int j = 0; j < jobs.
size (); ++j)
-
- 601 Json::Value const & counter{jq_counters[jobs[j].typeName]};
-
-
-
-
- 606 BEAST_EXPECT(counter[jss::started] ==
"2" );
- 607 BEAST_EXPECT(queued_dur_us == j + 1);
-
-
-
- 611 BEAST_EXPECT(counter[jss::started] ==
"1" );
- 612 BEAST_EXPECT(queued_dur_us == j + 1);
-
-
-
- 616 BEAST_EXPECT(counter[jss::started] ==
"0" );
- 617 BEAST_EXPECT(queued_dur_us == 0);
-
-
- 620 BEAST_EXPECT(counter[jss::queued] ==
"1" );
- 621 BEAST_EXPECT(counter[jss::finished] ==
"0" );
- 622 BEAST_EXPECT(counter[jss::running_duration_us] ==
"0" );
-
-
-
-
-
- 628 BEAST_EXPECT(
jsonToUint64 (total[jss::started]) == (i * 2) + 1);
- 629 BEAST_EXPECT(total[jss::finished] ==
"0" );
-
-
-
-
- 634 (((i * i) + 3 * i + 2) / 2));
- 635 BEAST_EXPECT(total[jss::running_duration_us] ==
"0" );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 650 BEAST_EXPECT(currents.size() == (i + 1) * 2);
-
-
- 653 for (
int j = 0; j <= i; ++j)
-
- 655 BEAST_EXPECT(currents[j * 2].name == jobs[j].typeName);
- 656 BEAST_EXPECT(prevDur > currents[j * 2].dur);
- 657 prevDur = currents[j * 2].dur;
-
- 659 BEAST_EXPECT(currents[(j * 2) + 1].name == jobs[j].typeName);
- 660 BEAST_EXPECT(prevDur > currents[(j * 2) + 1].dur);
- 661 prevDur = currents[(j * 2) + 1].dur;
-
-
-
-
- 666 for (
int i = jobs.
size () - 1; i >= 0; --i)
-
-
-
- 670 int const finished = ((jobs.
size () - i) * 2) - 1;
-
-
-
-
-
- 676 perfLog ->countersJson()[jss::job_queue]};
- 677 for (
int j = 0; j < jobs.
size (); ++j)
-
- 679 Json::Value const & counter{jq_counters[jobs[j].typeName]};
-
-
-
-
- 684 BEAST_EXPECT(counter[jss::finished] ==
"0" );
- 685 BEAST_EXPECT(running_dur_us == 0);
-
-
-
- 689 BEAST_EXPECT(counter[jss::finished] ==
"1" );
- 690 BEAST_EXPECT(running_dur_us == ((jobs.
size () - j) * 2) - 1);
-
-
-
- 694 BEAST_EXPECT(counter[jss::finished] ==
"2" );
- 695 BEAST_EXPECT(running_dur_us == ((jobs.
size () - j) * 4) - 1);
-
-
-
-
- 700 BEAST_EXPECT(queued_dur_us == j + 1);
- 701 BEAST_EXPECT(counter[jss::queued] ==
"1" );
- 702 BEAST_EXPECT(counter[jss::started] ==
"2" );
-
-
-
-
-
-
-
- 710 BEAST_EXPECT(
jsonToUint64 (total[jss::finished]) == finished);
-
-
-
- 714 int const queuedDur = ((jobs.
size () * (jobs.
size () + 1)) / 2);
-
- 716 jsonToUint64 (total[jss::queued_duration_us]) == queuedDur);
-
-
- 719 int const runningDur = ((finished * (finished + 1)) / 2);
-
-
-
-
-
-
-
-
-
-
-
-
-
- 733 BEAST_EXPECT(currents.size() == i * 2);
-
-
- 736 for (
int j = 0; j < i; ++j)
-
- 738 BEAST_EXPECT(currents[j * 2].name == jobs[j].typeName);
- 739 BEAST_EXPECT(prevDur > currents[j * 2].dur);
- 740 prevDur = currents[j * 2].dur;
-
- 742 BEAST_EXPECT(currents[(j * 2) + 1].name == jobs[j].typeName);
- 743 BEAST_EXPECT(prevDur > currents[(j * 2) + 1].dur);
- 744 prevDur = currents[(j * 2) + 1].dur;
-
-
-
-
- 749 auto validateFinalCounters = [
this ,
-
-
-
-
- 754 BEAST_EXPECT(rpc.
size () == 0);
-
-
- 757 Json::Value const & jobQueue = countersJson[jss::job_queue];
- 758 for (
int i = jobs.
size () - 1; i >= 0; --i)
-
- 760 Json::Value const & counter{jobQueue[jobs[i].typeName]};
-
-
- 763 BEAST_EXPECT(running_dur_us == ((jobs.
size () - i) * 4) - 1);
-
-
-
- 767 BEAST_EXPECT(queued_dur_us == i + 1);
-
- 769 BEAST_EXPECT(counter[jss::queued] ==
"1" );
- 770 BEAST_EXPECT(counter[jss::started] ==
"2" );
- 771 BEAST_EXPECT(counter[jss::finished] ==
"2" );
-
-
-
-
- 776 const int finished = jobs.
size () * 2;
-
- 778 BEAST_EXPECT(
jsonToUint64 (total[jss::started]) == finished);
- 779 BEAST_EXPECT(
jsonToUint64 (total[jss::finished]) == finished);
-
-
-
- 783 int const queuedDur = ((jobs.
size () * (jobs.
size () + 1)) / 2);
-
- 785 jsonToUint64 (total[jss::queued_duration_us]) == queuedDur);
-
-
- 788 int const runningDur = ((finished * (finished + 1)) / 2);
-
- 790 jsonToUint64 (total[jss::running_duration_us]) == runningDur);
-
-
- 793 auto validateFinalCurrent = [
this ](
Json::Value const & currentJson) {
-
-
-
- 797 BEAST_EXPECT(j.
size () == 0);
-
-
- 800 Json::Value const & methods = currentJson[jss::methods];
- 801 BEAST_EXPECT(methods.
size () == 0);
- 802 BEAST_EXPECT(methods.
isArray ());
-
-
-
- 806 validateFinalCounters(
perfLog ->countersJson());
- 807 validateFinalCurrent(
perfLog ->currentJson());
-
-
-
-
-
-
-
-
- 816 auto const fullPath = fixture.logFile();
-
-
-
- 820 BEAST_EXPECT(!exists(fullPath));
-
-
-
-
-
-
-
-
-
-
-
-
-
- 834 lastLine = std::move(line);
-
-
-
-
-
-
-
-
-
- 844 validateFinalCounters(parsedLastLine[jss::counters]);
- 845 validateFinalCurrent(parsedLastLine[jss::current_activities]);
-
-
-
-
-
-
-
-
-
-
-
-
-
- 859 auto perfLog {fixture.perfLog(withFile)};
-
-
-
-
-
-
-
-
-
- 869 auto iter{jobTypes.begin()};
-
-
- 872 jobType = iter->second.type();
- 873 jobTypeName = iter->second.name();
-
-
-
-
-
-
- 880 auto verifyCounters = [
this , jobTypeName](
-
-
-
-
-
- 886 BEAST_EXPECT(countersJson.
isObject ());
- 887 BEAST_EXPECT(countersJson.
size () == 2);
-
- 889 BEAST_EXPECT(countersJson.
isMember (jss::rpc));
- 890 BEAST_EXPECT(countersJson[jss::rpc].isObject());
- 891 BEAST_EXPECT(countersJson[jss::rpc].size() == 0);
-
- 893 BEAST_EXPECT(countersJson.
isMember (jss::job_queue));
- 894 BEAST_EXPECT(countersJson[jss::job_queue].isObject());
- 895 BEAST_EXPECT(countersJson[jss::job_queue].size() == 1);
-
-
- 898 countersJson[jss::job_queue][jobTypeName]};
-
- 900 BEAST_EXPECT(job.isObject());
-
- 902 BEAST_EXPECT(
jsonToUint64 (job[jss::started]) == started);
- 903 BEAST_EXPECT(
jsonToUint64 (job[jss::finished]) == finished);
-
-
- 906 jsonToUint64 (job[jss::queued_duration_us]) == queued_us);
+ 473 auto const fullPath = fixture.logFile();
+
+
+
+ 477 BEAST_EXPECT(!exists(fullPath));
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 491 lastLine = std::move(line);
+
+
+
+
+
+
+
+
+
+ 501 validateFinalCounters(parsedLastLine[jss::counters]);
+ 502 validateFinalCurrent(parsedLastLine[jss::current_activities]);
+
+
+
+
+
+
+
+
+
+
+
+ 514 auto perfLog {fixture.perfLog(withFile)};
+
+
+
+
+
+
+
+
+
+
+ 525 : type(t), typeName(std::move(name))
+
+
+
+
+
+
+
+
+ 534 for (
auto const & job : jobTypes)
+
+
+
+
+
+
+
+
+ 543 for (
int i = 0; i < jobs.
size (); ++i)
+
+ 545 perfLog ->jobQueue(jobs[i].type);
+
+ 547 perfLog ->countersJson()[jss::job_queue]};
+
+ 549 BEAST_EXPECT(jq_counters.size() == i + 2);
+ 550 for (
int j = 0; j <= i; ++j)
+
+
+
+ 554 Json::Value const & counter{jq_counters[jobs[j].typeName]};
+ 555 BEAST_EXPECT(counter.size() == 5);
+ 556 BEAST_EXPECT(counter[jss::queued] ==
"1" );
+ 557 BEAST_EXPECT(counter[jss::started] ==
"0" );
+ 558 BEAST_EXPECT(counter[jss::finished] ==
"0" );
+ 559 BEAST_EXPECT(counter[jss::queued_duration_us] ==
"0" );
+ 560 BEAST_EXPECT(counter[jss::running_duration_us] ==
"0" );
+
+
+
+
+ 565 BEAST_EXPECT(total.size() == 5);
+ 566 BEAST_EXPECT(
jsonToUint64 (total[jss::queued]) == i + 1);
+ 567 BEAST_EXPECT(total[jss::started] ==
"0" );
+ 568 BEAST_EXPECT(total[jss::finished] ==
"0" );
+ 569 BEAST_EXPECT(total[jss::queued_duration_us] ==
"0" );
+ 570 BEAST_EXPECT(total[jss::running_duration_us] ==
"0" );
+
+
+
+
+
+ 576 BEAST_EXPECT(
current .size() == 2);
+ 577 BEAST_EXPECT(
current .isMember(jss::jobs));
+ 578 BEAST_EXPECT(
current [jss::jobs].size() == 0);
+ 579 BEAST_EXPECT(
current .isMember(jss::methods));
+ 580 BEAST_EXPECT(
current [jss::methods].size() == 0);
+
+
+
+
+
+
+
+
+
+
+
+ 592 for (
int i = 0; i < jobs.
size (); ++i)
+
+
+ 595 jobs[i].type,
microseconds {i + 1}, steady_clock::now(), i * 2);
+
+
+
+
+ 600 perfLog ->countersJson()[jss::job_queue]};
+ 601 for (
int j = 0; j < jobs.
size (); ++j)
+
+ 603 Json::Value const & counter{jq_counters[jobs[j].typeName]};
+
+
+
+
+ 608 BEAST_EXPECT(counter[jss::started] ==
"2" );
+ 609 BEAST_EXPECT(queued_dur_us == j + 1);
+
+
+
+ 613 BEAST_EXPECT(counter[jss::started] ==
"1" );
+ 614 BEAST_EXPECT(queued_dur_us == j + 1);
+
+
+
+ 618 BEAST_EXPECT(counter[jss::started] ==
"0" );
+ 619 BEAST_EXPECT(queued_dur_us == 0);
+
+
+ 622 BEAST_EXPECT(counter[jss::queued] ==
"1" );
+ 623 BEAST_EXPECT(counter[jss::finished] ==
"0" );
+ 624 BEAST_EXPECT(counter[jss::running_duration_us] ==
"0" );
+
+
+
+
+
+ 630 BEAST_EXPECT(
jsonToUint64 (total[jss::started]) == (i * 2) + 1);
+ 631 BEAST_EXPECT(total[jss::finished] ==
"0" );
+
+
+
+
+ 636 (((i * i) + 3 * i + 2) / 2));
+ 637 BEAST_EXPECT(total[jss::running_duration_us] ==
"0" );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 652 BEAST_EXPECT(currents.size() == (i + 1) * 2);
+
+
+ 655 for (
int j = 0; j <= i; ++j)
+
+ 657 BEAST_EXPECT(currents[j * 2].name == jobs[j].typeName);
+ 658 BEAST_EXPECT(prevDur > currents[j * 2].dur);
+ 659 prevDur = currents[j * 2].dur;
+
+ 661 BEAST_EXPECT(currents[(j * 2) + 1].name == jobs[j].typeName);
+ 662 BEAST_EXPECT(prevDur > currents[(j * 2) + 1].dur);
+ 663 prevDur = currents[(j * 2) + 1].dur;
+
+
+
+
+ 668 for (
int i = jobs.
size () - 1; i >= 0; --i)
+
+
+
+ 672 int const finished = ((jobs.
size () - i) * 2) - 1;
+
+
+
+
+
+ 678 perfLog ->countersJson()[jss::job_queue]};
+ 679 for (
int j = 0; j < jobs.
size (); ++j)
+
+ 681 Json::Value const & counter{jq_counters[jobs[j].typeName]};
+
+
+
+
+ 686 BEAST_EXPECT(counter[jss::finished] ==
"0" );
+ 687 BEAST_EXPECT(running_dur_us == 0);
+
+
+
+ 691 BEAST_EXPECT(counter[jss::finished] ==
"1" );
+ 692 BEAST_EXPECT(running_dur_us == ((jobs.
size () - j) * 2) - 1);
+
+
+
+ 696 BEAST_EXPECT(counter[jss::finished] ==
"2" );
+ 697 BEAST_EXPECT(running_dur_us == ((jobs.
size () - j) * 4) - 1);
+
+
+
+
+ 702 BEAST_EXPECT(queued_dur_us == j + 1);
+ 703 BEAST_EXPECT(counter[jss::queued] ==
"1" );
+ 704 BEAST_EXPECT(counter[jss::started] ==
"2" );
+
+
+
+
+
+
+
+ 712 BEAST_EXPECT(
jsonToUint64 (total[jss::finished]) == finished);
+
+
+
+ 716 int const queuedDur = ((jobs.
size () * (jobs.
size () + 1)) / 2);
+
+ 718 jsonToUint64 (total[jss::queued_duration_us]) == queuedDur);
+
+
+ 721 int const runningDur = ((finished * (finished + 1)) / 2);
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 735 BEAST_EXPECT(currents.size() == i * 2);
+
+
+ 738 for (
int j = 0; j < i; ++j)
+
+ 740 BEAST_EXPECT(currents[j * 2].name == jobs[j].typeName);
+ 741 BEAST_EXPECT(prevDur > currents[j * 2].dur);
+ 742 prevDur = currents[j * 2].dur;
+
+ 744 BEAST_EXPECT(currents[(j * 2) + 1].name == jobs[j].typeName);
+ 745 BEAST_EXPECT(prevDur > currents[(j * 2) + 1].dur);
+ 746 prevDur = currents[(j * 2) + 1].dur;
+
+
+
+
+ 751 auto validateFinalCounters = [
this ,
+
+
+
+
+ 756 BEAST_EXPECT(rpc.
size () == 0);
+
+
+ 759 Json::Value const & jobQueue = countersJson[jss::job_queue];
+ 760 for (
int i = jobs.
size () - 1; i >= 0; --i)
+
+ 762 Json::Value const & counter{jobQueue[jobs[i].typeName]};
+
+
+ 765 BEAST_EXPECT(running_dur_us == ((jobs.
size () - i) * 4) - 1);
+
+
+
+ 769 BEAST_EXPECT(queued_dur_us == i + 1);
+
+ 771 BEAST_EXPECT(counter[jss::queued] ==
"1" );
+ 772 BEAST_EXPECT(counter[jss::started] ==
"2" );
+ 773 BEAST_EXPECT(counter[jss::finished] ==
"2" );
+
+
+
+
+ 778 const int finished = jobs.
size () * 2;
+
+ 780 BEAST_EXPECT(
jsonToUint64 (total[jss::started]) == finished);
+ 781 BEAST_EXPECT(
jsonToUint64 (total[jss::finished]) == finished);
+
+
+
+ 785 int const queuedDur = ((jobs.
size () * (jobs.
size () + 1)) / 2);
+
+ 787 jsonToUint64 (total[jss::queued_duration_us]) == queuedDur);
+
+
+ 790 int const runningDur = ((finished * (finished + 1)) / 2);
+
+ 792 jsonToUint64 (total[jss::running_duration_us]) == runningDur);
+
+
+ 795 auto validateFinalCurrent = [
this ](
Json::Value const & currentJson) {
+
+
+
+ 799 BEAST_EXPECT(j.
size () == 0);
+
+
+ 802 Json::Value const & methods = currentJson[jss::methods];
+ 803 BEAST_EXPECT(methods.
size () == 0);
+ 804 BEAST_EXPECT(methods.
isArray ());
+
+
+
+ 808 validateFinalCounters(
perfLog ->countersJson());
+ 809 validateFinalCurrent(
perfLog ->currentJson());
+
+
+
+
+
+
+
+
+ 818 auto const fullPath = fixture.logFile();
+
+
+
+ 822 BEAST_EXPECT(!exists(fullPath));
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 836 lastLine = std::move(line);
+
+
+
+
+
+
+
+
+
+ 846 validateFinalCounters(parsedLastLine[jss::counters]);
+ 847 validateFinalCurrent(parsedLastLine[jss::current_activities]);
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 861 auto perfLog {fixture.perfLog(withFile)};
+
+
+
+
+
+
+
+
+
+ 871 auto iter{jobTypes.begin()};
+
+
+ 874 jobType = iter->second.type();
+ 875 jobTypeName = iter->second.name();
+
+
+
+
+
+
+ 882 auto verifyCounters = [
this , jobTypeName](
+
+
+
+
+
+ 888 BEAST_EXPECT(countersJson.
isObject ());
+ 889 BEAST_EXPECT(countersJson.
size () == 2);
+
+ 891 BEAST_EXPECT(countersJson.
isMember (jss::rpc));
+ 892 BEAST_EXPECT(countersJson[jss::rpc].isObject());
+ 893 BEAST_EXPECT(countersJson[jss::rpc].size() == 0);
+
+ 895 BEAST_EXPECT(countersJson.
isMember (jss::job_queue));
+ 896 BEAST_EXPECT(countersJson[jss::job_queue].isObject());
+ 897 BEAST_EXPECT(countersJson[jss::job_queue].size() == 1);
+
+
+ 900 countersJson[jss::job_queue][jobTypeName]};
+
+ 902 BEAST_EXPECT(job.isObject());
+
+ 904 BEAST_EXPECT(
jsonToUint64 (job[jss::started]) == started);
+ 905 BEAST_EXPECT(
jsonToUint64 (job[jss::finished]) == finished);
+
- 908 jsonToUint64 (job[jss::running_duration_us]) == running_us);
-
-
-
-
- 913 auto verifyEmptyCurrent = [
this ](
Json::Value const & currentJson) {
- 914 BEAST_EXPECT(currentJson.isObject());
- 915 BEAST_EXPECT(currentJson.size() == 2);
-
- 917 BEAST_EXPECT(currentJson.isMember(jss::jobs));
- 918 BEAST_EXPECT(currentJson[jss::jobs].isArray());
- 919 BEAST_EXPECT(currentJson[jss::jobs].size() == 0);
-
- 921 BEAST_EXPECT(currentJson.isMember(jss::methods));
- 922 BEAST_EXPECT(currentJson[jss::methods].isArray());
- 923 BEAST_EXPECT(currentJson[jss::methods].size() == 0);
-
-
-
-
-
- 929 verifyCounters(
perfLog ->countersJson(), 1, 0, 11, 0);
- 930 verifyEmptyCurrent(
perfLog ->currentJson());
-
-
-
-
- 935 verifyCounters(
perfLog ->countersJson(), 2, 0, 24, 0);
- 936 verifyEmptyCurrent(
perfLog ->currentJson());
-
-
-
-
- 941 verifyCounters(
perfLog ->countersJson(), 2, 1, 24, 17);
- 942 verifyEmptyCurrent(
perfLog ->currentJson());
-
-
-
-
- 947 verifyCounters(
perfLog ->countersJson(), 2, 2, 24, 36);
- 948 verifyEmptyCurrent(
perfLog ->currentJson());
-
-
-
-
-
-
-
-
- 957 auto const fullPath = fixture.logFile();
-
-
-
- 961 BEAST_EXPECT(!exists(fullPath));
-
-
-
-
-
-
-
-
-
-
-
-
-
- 975 lastLine = std::move(line);
-
-
-
-
-
-
-
-
-
- 985 verifyCounters(parsedLastLine[jss::counters], 2, 2, 24, 36);
- 986 verifyEmptyCurrent(parsedLastLine[jss::current_activities]);
-
-
-
-
-
-
-
-
-
- 996 using namespace boost::filesystem;
-
-
- 999 BEAST_EXPECT(!exists(fixture.logDir()));
-
- 1001 auto perfLog {fixture.perfLog(withFile)};
+ 908 jsonToUint64 (job[jss::queued_duration_us]) == queued_us);
+
+ 910 jsonToUint64 (job[jss::running_duration_us]) == running_us);
+
+
+
+
+ 915 auto verifyEmptyCurrent = [
this ](
Json::Value const & currentJson) {
+ 916 BEAST_EXPECT(currentJson.isObject());
+ 917 BEAST_EXPECT(currentJson.size() == 2);
+
+ 919 BEAST_EXPECT(currentJson.isMember(jss::jobs));
+ 920 BEAST_EXPECT(currentJson[jss::jobs].isArray());
+ 921 BEAST_EXPECT(currentJson[jss::jobs].size() == 0);
+
+ 923 BEAST_EXPECT(currentJson.isMember(jss::methods));
+ 924 BEAST_EXPECT(currentJson[jss::methods].isArray());
+ 925 BEAST_EXPECT(currentJson[jss::methods].size() == 0);
+
+
+
+
+
+ 931 verifyCounters(
perfLog ->countersJson(), 1, 0, 11, 0);
+ 932 verifyEmptyCurrent(
perfLog ->currentJson());
+
+
+
+
+ 937 verifyCounters(
perfLog ->countersJson(), 2, 0, 24, 0);
+ 938 verifyEmptyCurrent(
perfLog ->currentJson());
+
+
+
+
+ 943 verifyCounters(
perfLog ->countersJson(), 2, 1, 24, 17);
+ 944 verifyEmptyCurrent(
perfLog ->currentJson());
+
+
+
+
+ 949 verifyCounters(
perfLog ->countersJson(), 2, 2, 24, 36);
+ 950 verifyEmptyCurrent(
perfLog ->currentJson());
+
+
+
+
+
+
+
+
+ 959 auto const fullPath = fixture.logFile();
+
+
+
+ 963 BEAST_EXPECT(!exists(fullPath));
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 977 lastLine = std::move(line);
+
+
+
+
+
+
+
+
+
+ 987 verifyCounters(parsedLastLine[jss::counters], 2, 2, 24, 36);
+ 988 verifyEmptyCurrent(parsedLastLine[jss::current_activities]);
+
+
+
+
+
+
+
+
+
+ 998 using namespace boost::filesystem;
+
+
+ 1001 BEAST_EXPECT(!exists(fixture.logDir()));
- 1003 BEAST_EXPECT(fixture.stopSignaled ==
false );
-
-
- 1006 BEAST_EXPECT(!exists(fixture.logDir()));
-
-
-
- 1010 BEAST_EXPECT(exists(fixture.logFile()));
- 1011 BEAST_EXPECT(file_size(fixture.logFile()) == 0);
-
-
-
-
-
-
-
- 1019 decltype(file_size(fixture.logFile())) firstFileSize{0};
-
-
- 1022 BEAST_EXPECT(!exists(fixture.logDir()));
-
-
-
- 1026 firstFileSize = file_size(fixture.logFile());
- 1027 BEAST_EXPECT(firstFileSize > 0);
-
-
-
-
-
-
-
+ 1003 auto perfLog {fixture.perfLog(withFile)};
+
+ 1005 BEAST_EXPECT(fixture.stopSignaled ==
false );
+
+
+ 1008 BEAST_EXPECT(!exists(fixture.logDir()));
+
+
+
+ 1012 BEAST_EXPECT(exists(fixture.logFile()));
+ 1013 BEAST_EXPECT(file_size(fixture.logFile()) == 0);
+
+
+
+
+
+
+
+ 1021 decltype(file_size(fixture.logFile())) firstFileSize{0};
+
+
+ 1024 BEAST_EXPECT(!exists(fixture.logDir()));
+
+
+
+ 1028 firstFileSize = file_size(fixture.logFile());
+ 1029 BEAST_EXPECT(firstFileSize > 0);
+
+
+
+
+
-
-
- 1038 BEAST_EXPECT(!exists(fixture.logDir()));
-
-
-
- 1042 BEAST_EXPECT(file_size(fixture.logFile()) > firstFileSize);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ 1040 BEAST_EXPECT(!exists(fixture.logDir()));
+
+
+
+ 1044 BEAST_EXPECT(file_size(fixture.logFile()) > firstFileSize);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-std::unique_ptr< perf::PerfLog > perfLog(WithFile withFile)
+std::unique_ptr< perf::PerfLog > perfLog(WithFile withFile)
-
+
-
+
BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, ripple)
-std::chrono::milliseconds logInterval() const
-void testRotate(WithFile withFile)
+std::chrono::milliseconds logInterval() const
+void testRotate(WithFile withFile)
+std::set< char const * > getHandlerNames()
Return names of all methods.
-
+
-void testJobs(WithFile withFile)
+void testJobs(WithFile withFile)
T back_inserter(T... args)
std::unique_ptr< PerfLog > make_PerfLog(PerfLog::Setup const &setup, Application &app, beast::Journal journal, std::function< void()> &&signalStop)
-static std::vector< Cur > getSortedCurrent(Json::Value const ¤tJson)
+static std::vector< Cur > getSortedCurrent(Json::Value const ¤tJson)
-static std::uint64_t jsonToUint64(Json::Value const &jsonUintAsString)
-
-
+static std::uint64_t jsonToUint64(Json::Value const &jsonUintAsString)
+
+
Unserialize a JSON document into a Value.
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
-
+
-
-
+
+
Configuration from [perf] section of rippled.cfg.
-Cur(std::uint64_t d, std::string n)
-void testRPC(WithFile withFile)
+Cur(std::uint64_t d, std::string n)
+void testRPC(WithFile withFile)
bool contains_error(Json::Value const &json)
Returns true if the json contains an rpc error specification.
-
-boost::filesystem::path path
+
+boost::filesystem::path path
-Fixture(Application &app, beast::Journal j)
-
+Fixture(Application &app, beast::Journal j)
+
static JobTypes const & instance()
-
+
beast::xor_shift_engine & default_prng()
Return the default random engine.
UInt size() const
Number of values in array or object.
@@ -1190,33 +1193,32 @@ $(function() {
A generic endpoint for log messages.
-
+
-
-
+
+
T emplace_back(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual beast::Journal journal(std::string const &name)=0
-
+
bool parse(std::string const &document, Value &root)
Read a Value from a JSON document.
-void testInvalidID(WithFile withFile)
+void testInvalidID(WithFile withFile)
-
-
+
+
-std::vector< char const * > getHandlerNames()
Return names of all methods.
-
+
A transaction testing environment.
diff --git a/RPCHandler_8cpp_source.html b/RPCHandler_8cpp_source.html
index bf85c3f09f..89e1aa2e14 100644
--- a/RPCHandler_8cpp_source.html
+++ b/RPCHandler_8cpp_source.html
@@ -303,13 +303,13 @@ $(function() {
-Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
+Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
@ arrayValue
array value (ordered list)
Role roleRequired(unsigned int version, bool betaEnabled, std::string const &method)
void injectReportingWarning(RPC::JsonContext &context, Json::Value &result)
const Charge feeReferenceRPC
-
+
@@ -318,7 +318,7 @@ $(function() {
Value & append(const Value &value)
Append value to array at the end.
-
+
@ objectValue
object value (collection of name/value pairs).
@@ -334,10 +334,10 @@ $(function() {
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.
Status
Return codes from Backend operations.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
-Method< Json::Value > valueMethod_
+Method< Json::Value > valueMethod_
bool shouldForwardToP2p(RPC::JsonContext &context)
Whether a request should be forwarded, based on request parameters.
-error_code_i conditionMet(Condition condition_required, T &context)
+error_code_i conditionMet(Condition condition_required, T &context)
const Charge feeExceptionRPC
diff --git a/RPCHelpers_8h_source.html b/RPCHelpers_8h_source.html
index da3cbdbaef..492689c72b 100644
--- a/RPCHelpers_8h_source.html
+++ b/RPCHelpers_8h_source.html
@@ -226,52 +226,54 @@ $(function() {
-
-
-
-
-
- 250 template <
class Object>
-
- 252 setVersion (Object& parent,
unsigned int apiVersion,
bool betaEnabled)
-
-
- 255 auto &&
object = addObject(parent, jss::version);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ 252 template <
class Object>
+
+ 254 setVersion (Object& parent,
unsigned int apiVersion,
bool betaEnabled)
+
+
+ 257 auto &&
object = addObject(parent, jss::version);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
constexpr unsigned int apiInvalidVersion
API version numbers used in later API versions.
@@ -314,6 +316,7 @@ $(function() {
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool isValidated(LedgerMaster &ledgerMaster, ReadView const &ledger, Application &app)
Status getLedger(T &ledger, uint256 const &ledgerHash, Context &context)
Get ledger by hash If there is no error in the return value, the ledger pointer will have been filled...
+constexpr unsigned int apiMaximumValidVersion
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const ¶ms)
std::uint64_t getStartHint(std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Gets the start hint for traversing account objects.
std::optional< Seed > getSeedFromRPC(Json::Value const ¶ms, Json::Value &error)
@@ -328,7 +331,7 @@ $(function() {
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
bool isRelatedToAccount(ReadView const &ledger, std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Tests if a SLE is owned by accountID.
-void setVersion(Object &parent, unsigned int apiVersion, bool betaEnabled)
+void setVersion(Object &parent, unsigned int apiVersion, bool betaEnabled)