From 9bea83c2c36752b07667ad4ad77ecdef12ce67d3 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 25 May 2014 13:07:56 -0400 Subject: [PATCH] Filter - Generates debug message about filtering process. --- src/Filter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Filter.cpp b/src/Filter.cpp index 6804574e2..92dbf73bc 100644 --- a/src/Filter.cpp +++ b/src/Filter.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include extern Context context; @@ -72,6 +73,8 @@ void Filter::subset (const std::vector & input, std::vector & output { context.timer_filter.start (); + _startCount = (int) input.size (); + if (context.config.getBoolean ("debug")) { Tree* t = context.parser.tree (); @@ -109,6 +112,8 @@ void Filter::subset (const std::vector & input, std::vector & output else output = input; + _endCount = (int) output.size (); + context.debug (format ("Filtered {1} tasks --> {2} tasks", _startCount, _endCount)); context.timer_filter.stop (); } @@ -133,6 +138,7 @@ void Filter::subset (std::vector & output) context.timer_filter.stop (); const std::vector & pending = context.tdb2.pending.get_tasks (); context.timer_filter.start (); + _startCount = (int) pending.size (); Eval eval; eval.addSource (namedDates); @@ -163,6 +169,7 @@ void Filter::subset (std::vector & output) context.timer_filter.stop (); const std::vector & completed = context.tdb2.completed.get_tasks (); // TODO Optional context.timer_filter.start (); + _startCount += (int) completed.size (); for (task = completed.begin (); task != completed.end (); ++task) { @@ -193,6 +200,8 @@ void Filter::subset (std::vector & output) output.push_back (*task); } + _endCount = (int) output.size (); + context.debug (format ("Filtered {1} tasks --> {2} tasks", _startCount, _endCount)); context.timer_filter.stop (); }