From 27df379f1dcdf4d6cc7a9f63f8606ee8c1c7a10a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 6 Oct 2012 12:21:32 -0400 Subject: [PATCH] Statistics - Added a backlog transaction count to the statistics. --- src/commands/CmdStatistics.cpp | 11 +++++++++++ src/en-US.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/commands/CmdStatistics.cpp b/src/commands/CmdStatistics.cpp index 0578f5c3a..adfbb6c86 100644 --- a/src/commands/CmdStatistics.cpp +++ b/src/commands/CmdStatistics.cpp @@ -73,6 +73,13 @@ int CmdStatistics::execute (std::string& output) if (*tx == "---") ++undoCount; + // Count the backlog transactions. + std::vector backlogTxns = context.tdb2.backlog.get_lines (); + int backlogCount = 0; + for (tx = backlogTxns.begin (); tx != backlogTxns.end (); ++tx) + if ((*tx)[0] == '[') + ++backlogCount; + // Get all the tasks. std::vector all = context.tdb2.all_tasks (); std::vector filtered; @@ -205,6 +212,10 @@ int CmdStatistics::execute (std::string& output) view.set (row, 0, STRING_CMD_STATS_UNDO_TXNS); view.set (row, 1, undoCount); + row = view.addRow (); + view.set (row, 0, STRING_CMD_STATS_BACKLOG); + view.set (row, 1, backlogCount); + if (totalT) { row = view.addRow (); diff --git a/src/en-US.h b/src/en-US.h index cef234dca..144ca6a75 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -249,6 +249,7 @@ #define STRING_CMD_STATS_PROJECTS "Projects" #define STRING_CMD_STATS_DATA_SIZE "Data size" #define STRING_CMD_STATS_UNDO_TXNS "Undo transactions" +#define STRING_CMD_STATS_BACKLOG "Sync backlog transactions" #define STRING_CMD_STATS_TAGGED "Tasks tagged" #define STRING_CMD_STATS_OLDEST "Oldest task" #define STRING_CMD_STATS_NEWEST "Newest task"