summaryrefslogtreecommitdiffhomepage
path: root/whiteboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'whiteboard.cpp')
-rw-r--r--whiteboard.cpp8
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);
}