From af3be5f96463bcba6ddf4cd26e2ead9d925287b1 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 10 Feb 2009 15:57:34 -0400 Subject: Wrote the beginnings of a new "stats" command. --- src/output.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/output.h') diff --git a/src/output.h b/src/output.h index fd462040..ada7b21c 100644 --- a/src/output.h +++ b/src/output.h @@ -78,6 +78,41 @@ public: virtual void operator()(xact_t& xact); }; +/** + * @brief Brief + * + * Long. + */ +class gather_statistics : public item_handler +{ +protected: + report_t& report; + entry_t * last_entry; + xact_t * last_xact; + + struct statistics_t { + std::size_t total_entries; + std::size_t total_xacts; + + statistics_t() + : total_entries(0), + total_xacts(0) {} + } + statistics; + +public: + gather_statistics(report_t& _report) + : report(_report), last_entry(NULL), last_xact(NULL) { + TRACE_CTOR(gather_statistics, "report&"); + } + virtual ~gather_statistics() { + TRACE_DTOR(gather_statistics); + } + + virtual void flush(); + virtual void operator()(xact_t& xact); +}; + /** * @brief Brief * -- cgit v1.2.3