1#include <xrpld/app/ledger/InboundLedgers.h>
2#include <xrpld/app/ledger/LedgerMaster.h>
3#include <xrpld/app/main/Application.h>
4#include <xrpld/app/rdb/backend/SQLiteDatabase.h>
5#include <xrpld/rpc/Context.h>
7#include <xrpl/basics/UptimeClock.h>
8#include <xrpl/json/json_forwards.h>
9#include <xrpl/json/json_value.h>
10#include <xrpl/nodestore/Database.h>
11#include <xrpl/protocol/jss.h>
12#include <xrpl/server/NetworkOPs.h>
32 seconds -= unitVal * i;
52 for (
auto const& [k, v] : objectCounts)
64 ret[jss::dbKBTotal] = dbKB;
66 dbKB = db.getKBUsedLedger();
69 ret[jss::dbKBLedger] = dbKB;
71 dbKB = db.getKBUsedTransaction();
74 ret[jss::dbKBTransaction] = dbKB;
79 ret[jss::local_txs] =
static_cast<json::UInt>(c);
85 ret[jss::historical_perminute] =
static_cast<int>(app.
getInboundLedgers().fetchRate());
91 ret[jss::fullbelow_size] =
static_cast<int>(app.
getNodeFamily().getFullBelowCache()->size());
97 using namespace std::chrono_literals;
98 textTime(uptime, s,
"year", 365 * 24h);
101 textTime(uptime, s,
"minute", 1min);
103 ret[jss::uptime] = uptime;
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Config & config()=0
List getCounts(int minimumThreshold) const
static CountedObjects & getInstance() noexcept
virtual std::shared_ptr< TreeNodeCache > getTreeNodeCache()=0
Return a pointer to the Family Tree Node Cache.
virtual std::size_t getLocalTxCount()=0
void getCountsJson(json::Value &obj)
virtual std::int32_t getWriteLoad() const =0
Retrieve the estimated number of pending write operations.
virtual uint32_t getKBUsedAll()=0
getKBUsedAll Returns the amount of space used by all databases.
virtual RelationalDatabase & getRelationalDatabase()=0
virtual NetworkOPs & getOPs()=0
virtual NodeStore::Database & getNodeStore()=0
virtual InboundLedgers & getInboundLedgers()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual Family & getNodeFamily()=0
virtual TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache()=0
virtual CachedSLEs & getCachedSLEs()=0
double rate() const
Returns the fraction of cache hits.
std::chrono::time_point< UptimeClock > time_point
@ Object
object value (collection of name/value pairs).
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static void textTime(std::string &text, UptimeClock::time_point &seconds, char const *unitName, std::chrono::seconds unitVal)
json::Value doGetCounts(RPC::JsonContext &context)
json::Value getCountsJson(Application &app, int minObjectCount)
T time_since_epoch(T... args)