From 850a23b09e22b92cd3fce63322b5cc886911d2dc Mon Sep 17 00:00:00 2001 From: tatiana-yan Date: Wed, 1 Aug 2018 12:54:30 +0300 Subject: [PATCH] [search] Log search time --- map/everywhere_search_callback.cpp | 2 ++ map/search_api.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/map/everywhere_search_callback.cpp b/map/everywhere_search_callback.cpp index 39ad55e9d9..fa524c8a85 100644 --- a/map/everywhere_search_callback.cpp +++ b/map/everywhere_search_callback.cpp @@ -20,6 +20,8 @@ void EverywhereSearchCallback::operator()(Results const & results) auto const prevSize = m_productInfo.size(); ASSERT_LESS_OR_EQUAL(prevSize, results.GetCount(), ()); + LOG(LINFO, ("Emitted", results.GetCount() - prevSize, "search results.")); + for (size_t i = prevSize; i < results.GetCount(); ++i) { m_productInfo.push_back(m_productInfoDelegate.GetProductInfo(results[i])); diff --git a/map/search_api.cpp b/map/search_api.cpp index f2fa862bea..a28a3e978f 100644 --- a/map/search_api.cpp +++ b/map/search_api.cpp @@ -16,7 +16,9 @@ #include "geometry/mercator.hpp" +#include "base/scope_guard.hpp" #include "base/string_utils.hpp" +#include "base/timer.hpp" #include #include @@ -178,6 +180,11 @@ bool SearchAPI::SearchEverywhere(EverywhereSearchParams const & params) m_delegate.OnBookingFilterParamsUpdate(params.m_bookingFilterTasks); + LOG(LINFO, ("Search everywhere started.")); + my::Timer timer; + MY_SCOPE_GUARD(printDuration, [&timer]() { + LOG(LINFO, ("Search everywhere ended. Time:", timer.ElapsedSeconds(), "seconds.")); + }); return Search(p, true /* forceSearch */); }