diff options
author | Roland Reichwein <mail@reichwein.it> | 2023-02-04 12:43:51 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2023-02-04 12:43:51 +0100 |
commit | c4a1f194e79a7834a54fdbf63d73c33e434b4825 (patch) | |
tree | 51eae6c701f38e47790b7200b423de8c89b38465 /whiteboard.cpp | |
parent | 1771f788a5b9e844f0a5315faee104648e3b7d88 (diff) |
Added stats.html
Diffstat (limited to 'whiteboard.cpp')
-rw-r--r-- | whiteboard.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/whiteboard.cpp b/whiteboard.cpp index 8736726..ce196f4 100644 --- a/whiteboard.cpp +++ b/whiteboard.cpp @@ -233,6 +233,14 @@ std::string Whiteboard::handle_request(Whiteboard::connection& c, const std::str {"type", "version"}, {"version", WHITEBOARD_VERSION } }); + } else if (command == "getstats") { + return make_xml({ + {"type", "stats" }, + {"dbsizegross", std::to_string(m_storage->dbsize_gross()) }, + {"dbsizenet", std::to_string(m_storage->dbsize_net()) }, + {"numberofdocuments", std::to_string(m_storage->getNumberOfDocuments()) }, + {"numberofconnections", std::to_string(m_registry.number_of_connections()) }, + }); } else { throw std::runtime_error("Bad command: "s + command); } |