diff --git a/drape/drape_diagnostics.hpp b/drape/drape_diagnostics.hpp index 10fd9898d6..6d64b6a89e 100644 --- a/drape/drape_diagnostics.hpp +++ b/drape/drape_diagnostics.hpp @@ -11,11 +11,11 @@ //#define DEBUG_MESSAGE_QUEUE //#define RENDER_DEBUG_INFO_LABELS -//#define DRAPE_MEASURER +//#define DRAPE_MEASURER_BENCHMARK //#define SCENARIO_ENABLE //#define SHOW_FRAMES_STATS -#ifdef DRAPE_MEASURER +#ifdef DRAPE_MEASURER_BENCHMARK //#define RENDER_STATISTIC //#define TILES_STATISTIC diff --git a/drape_frontend/backend_renderer.cpp b/drape_frontend/backend_renderer.cpp index 5ce46dafff..c8d75dc2df 100644 --- a/drape_frontend/backend_renderer.cpp +++ b/drape_frontend/backend_renderer.cpp @@ -228,7 +228,7 @@ void BackendRenderer::AcceptMessage(ref_ptr message) { CHECK(m_context != nullptr, ()); ref_ptr batcher = m_batchersPool->GetBatcher(tileKey); -#if defined(DRAPE_MEASURER) && defined(GENERATING_STATISTIC) +#if defined(DRAPE_MEASURER_BENCHMARK) && defined(GENERATING_STATISTIC) DrapeMeasurer::Instance().StartShapesGeneration(); #endif for (drape_ptr const & shape : msg->GetShapes()) @@ -236,7 +236,7 @@ void BackendRenderer::AcceptMessage(ref_ptr message) batcher->SetFeatureMinZoom(shape->GetFeatureMinZoom()); shape->Draw(m_context, batcher, m_texMng); } -#if defined(DRAPE_MEASURER) && defined(GENERATING_STATISTIC) +#if defined(DRAPE_MEASURER_BENCHMARK) && defined(GENERATING_STATISTIC) DrapeMeasurer::Instance().EndShapesGeneration(static_cast(msg->GetShapes().size())); #endif } @@ -252,7 +252,7 @@ void BackendRenderer::AcceptMessage(ref_ptr message) CHECK(m_context != nullptr, ()); CleanupOverlays(tileKey); -#if defined(DRAPE_MEASURER) && defined(GENERATING_STATISTIC) +#if defined(DRAPE_MEASURER_BENCHMARK) && defined(GENERATING_STATISTIC) DrapeMeasurer::Instance().StartOverlayShapesGeneration(); #endif OverlayBatcher batcher(tileKey); @@ -267,7 +267,7 @@ void BackendRenderer::AcceptMessage(ref_ptr message) std::move(renderData.begin(), renderData.end(), back_inserter(m_overlays)); } -#if defined(DRAPE_MEASURER) && defined(GENERATING_STATISTIC) +#if defined(DRAPE_MEASURER_BENCHMARK) && defined(GENERATING_STATISTIC) DrapeMeasurer::Instance().EndOverlayShapesGeneration( static_cast(msg->GetShapes().size())); #endif diff --git a/drape_frontend/base_renderer.cpp b/drape_frontend/base_renderer.cpp index 4ba33db5cd..ca60dac166 100644 --- a/drape_frontend/base_renderer.cpp +++ b/drape_frontend/base_renderer.cpp @@ -123,6 +123,8 @@ void BaseRenderer::CheckRenderingEnabled() context->SetRenderingEnabled(false); } + OnRenderingDisabled(); + // notify initiator-thread about rendering disabling Notify(); @@ -152,6 +154,8 @@ void BaseRenderer::CheckRenderingEnabled() // m_renderingEnablingCompletionHandler will be setup before awakening of this thread Notify(); + OnRenderingEnabled(); + if (needCreateContext) { DisableMessageFiltering(); diff --git a/drape_frontend/base_renderer.hpp b/drape_frontend/base_renderer.hpp index 714779bd64..08bf62c297 100644 --- a/drape_frontend/base_renderer.hpp +++ b/drape_frontend/base_renderer.hpp @@ -63,6 +63,9 @@ protected: virtual void OnContextCreate() = 0; virtual void OnContextDestroy() = 0; + virtual void OnRenderingEnabled() {} + virtual void OnRenderingDisabled() {} + private: using TCompletionHandler = std::function; diff --git a/drape_frontend/drape_measurer.cpp b/drape_frontend/drape_measurer.cpp index dbc88983ad..5ea3b1d93f 100644 --- a/drape_frontend/drape_measurer.cpp +++ b/drape_frontend/drape_measurer.cpp @@ -1,5 +1,11 @@ #include "drape_frontend/drape_measurer.hpp" +#include "platform/platform.hpp" + +#include "geometry/mercator.hpp" + +#include "3party/Alohalytics/src/alohalytics.h" + #include namespace df @@ -10,14 +16,15 @@ DrapeMeasurer & DrapeMeasurer::Instance() return s_inst; } -void DrapeMeasurer::StartBenchmark() +void DrapeMeasurer::Start() { using namespace std::chrono; + if (m_isEnabled) + return; + m_isEnabled = true; -#if defined(GENERATING_STATISTIC) || defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM) auto currentTime = steady_clock::now(); -#endif #ifdef GENERATING_STATISTIC m_startScenePreparingTime = currentTime; @@ -39,7 +46,7 @@ void DrapeMeasurer::StartBenchmark() } #endif -#ifdef RENDER_STATISTIC +#if defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM) m_totalTPF = steady_clock::duration::zero(); m_totalTPFCount = 0; @@ -47,18 +54,27 @@ void DrapeMeasurer::StartBenchmark() m_fpsDistribution.clear(); m_totalFPS = 0.0; m_totalFPSCount = 0; -#endif - -#if defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM) - m_startFrameRenderTime = currentTime; - m_totalFrameRenderTime = steady_clock::duration::zero(); - m_totalFramesCount = 0; + m_startImmediateRenderingTime = currentTime; m_immediateRenderingFramesCount = 0; m_immediateRenderingTimeSum = steady_clock::duration::zero(); m_immediateRenderingMinFps = std::numeric_limits::max(); + + m_totalFrameRenderTime = steady_clock::duration::zero(); + m_totalFramesCount = 0; #endif + m_startFrameRenderTime = currentTime; + + if (m_realtimeTotalFramesCount == 0) + { + m_realtimeMinFrameRenderTime = steady_clock::duration::max(); + m_realtimeMaxFrameRenderTime = steady_clock::duration::min(); + m_realtimeTotalFrameRenderTime = steady_clock::duration::zero(); + m_realtimeSlowFramesCount = 0; + m_realtimeRenderingBox = {}; + } + #ifdef TRACK_GPU_MEM m_maxSnapshotValues = dp::GPUMemTracker::GPUMemorySnapshot(); m_summarySnapshotValues = dp::GPUMemTracker::GPUMemorySnapshot(); @@ -66,9 +82,51 @@ void DrapeMeasurer::StartBenchmark() #endif } -void DrapeMeasurer::StopBenchmark() +void DrapeMeasurer::Stop(bool forceProcessRealtimeStats /* = false */ ) { + using namespace std::chrono; + if (!m_isEnabled) + return; + m_isEnabled = false; + +#ifndef DRAPE_MEASURER_BENCHMARK + if ((forceProcessRealtimeStats && m_realtimeTotalFramesCount > 0) || + m_realtimeTotalFramesCount >= 1000) + { + auto const minMs = duration_cast(m_realtimeMinFrameRenderTime).count(); + auto const maxMs = duration_cast(m_realtimeMaxFrameRenderTime).count(); + auto const avgMs = duration_cast(m_realtimeTotalFrameRenderTime).count() / + m_realtimeTotalFramesCount; + + auto const latLonRect = MercatorBounds::ToLatLonRect(m_realtimeRenderingBox); + alohalytics::Stats::Instance().LogEvent( + "RenderingStats", {{"version", GetPlatform().GetAppUserAgent().GetAppVersion()}, + {"device", GetPlatform().DeviceModel()}, + {"gpu", m_gpuName}, + {"api", DebugPrint(m_apiVersion)}, + {"minFrameTime", strings::to_string(minMs)}, + {"maxFrameTime", strings::to_string(maxMs)}, + {"avgFrameTime", strings::to_string(avgMs)}, + {"slowFrames", strings::to_string(m_realtimeSlowFramesCount)}, + {"frames", strings::to_string(m_realtimeTotalFramesCount)}, + {"viewportMinLat", strings::to_string(latLonRect.minX())}, + {"viewportMinLon", strings::to_string(latLonRect.minY())}, + {"viewportMaxLat", strings::to_string(latLonRect.maxX())}, + {"viewportMaxLon", strings::to_string(latLonRect.maxY())}}); + m_realtimeTotalFramesCount = 0; + } +#endif +} + +void DrapeMeasurer::SetApiVersion(dp::ApiVersion apiVersion) +{ + m_apiVersion = apiVersion; +} + +void DrapeMeasurer::SetGpuName(std::string const & gpuName) +{ + m_gpuName = gpuName; } #ifdef GENERATING_STATISTIC @@ -145,7 +203,6 @@ DrapeMeasurer::GeneratingStatistic DrapeMeasurer::GetGeneratingStatistic() return statistic; } - #endif #ifdef RENDER_STATISTIC @@ -204,7 +261,6 @@ DrapeMeasurer::RenderStatistic DrapeMeasurer::GetRenderStatistic() } #endif -#if defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM) void DrapeMeasurer::BeforeRenderFrame() { if (!m_isEnabled) @@ -213,6 +269,59 @@ void DrapeMeasurer::BeforeRenderFrame() m_startFrameRenderTime = std::chrono::steady_clock::now(); } +void DrapeMeasurer::AfterRenderFrame(bool isActiveFrame, m2::PointD const & viewportCenter) +{ + using namespace std::chrono; + + if (!m_isEnabled) + return; + + auto const frameTime = steady_clock::now() - m_startFrameRenderTime; + if (isActiveFrame) + { + if (MercatorBounds::FullRect().IsPointInside(viewportCenter)) + m_realtimeRenderingBox.Add(viewportCenter); + m_realtimeTotalFrameRenderTime += frameTime; + m_realtimeMinFrameRenderTime = std::min(m_realtimeMinFrameRenderTime, frameTime); + m_realtimeMaxFrameRenderTime = std::max(m_realtimeMaxFrameRenderTime, frameTime); + + auto const frameTimeMs = duration_cast(frameTime).count(); + if (frameTimeMs <= 30) + ++m_realtimeSlowFramesCount; + + ++m_realtimeTotalFramesCount; + } + +#if defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM) + ++m_totalFramesCount; + m_totalFrameRenderTime += frameTime; + + auto const elapsed = duration_cast(m_totalFrameRenderTime).count(); + if (elapsed >= 30) + { + double fps = m_totalFramesCount * 1000.0 / elapsed; + m_minFPS = std::min(m_minFPS, static_cast(fps)); + + m_totalFPS += fps; + ++m_totalFPSCount; + + m_totalTPF += m_totalFrameRenderTime / m_totalFramesCount; + ++m_totalTPFCount; + + auto const fpsGroup = (static_cast(fps) / 10) * 10; + m_fpsDistribution[fpsGroup]++; + + m_totalFramesCount = 0; + m_totalFrameRenderTime = steady_clock::duration::zero(); + +#ifdef TRACK_GPU_MEM + TakeGPUMemorySnapshot(); +#endif + } +#endif +} + +#if defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM) void DrapeMeasurer::BeforeImmediateRendering() { if (!m_isEnabled) @@ -239,42 +348,6 @@ void DrapeMeasurer::AfterImmediateRendering() m_immediateRenderingMinFps = std::min(m_immediateRenderingMinFps, fps); } } - -void DrapeMeasurer::AfterRenderFrame() -{ - using namespace std::chrono; - - if (!m_isEnabled) - return; - - ++m_totalFramesCount; - m_totalFrameRenderTime += (steady_clock::now() - m_startFrameRenderTime); - - auto const elapsed = duration_cast(m_totalFrameRenderTime).count(); - if (elapsed >= 30) - { -#ifdef RENDER_STATISTIC - double fps = m_totalFramesCount * 1000.0 / elapsed; - m_minFPS = std::min(m_minFPS, static_cast(fps)); - - m_totalFPS += fps; - ++m_totalFPSCount; - - m_totalTPF += m_totalFrameRenderTime / m_totalFramesCount; - ++m_totalTPFCount; - - auto const fpsGroup = (static_cast(fps) / 10) * 10; - m_fpsDistribution[fpsGroup]++; -#endif - - m_totalFramesCount = 0; - m_totalFrameRenderTime = steady_clock::duration::zero(); - -#ifdef TRACK_GPU_MEM - TakeGPUMemorySnapshot(); -#endif - } -} #endif #ifdef TILES_STATISTIC diff --git a/drape_frontend/drape_measurer.hpp b/drape_frontend/drape_measurer.hpp index 5e30be00a2..a5be01040a 100644 --- a/drape_frontend/drape_measurer.hpp +++ b/drape_frontend/drape_measurer.hpp @@ -4,6 +4,8 @@ #include "drape/utils/gpu_mem_tracker.hpp" #include "drape/utils/glyph_usage_tracker.hpp" +#include "geometry/rect2d.hpp" + #include "base/thread.hpp" #include "base/timer.hpp" @@ -14,6 +16,7 @@ #include #include #include +#include namespace df { @@ -22,8 +25,11 @@ class DrapeMeasurer public: static DrapeMeasurer & Instance(); - void StartBenchmark(); - void StopBenchmark(); + void Start(); + void Stop(bool forceProcessRealtimeStats = false); + + void SetGpuName(std::string const & gpuName); + void SetApiVersion(dp::ApiVersion apiVersion); #ifdef RENDER_STATISTIC struct RenderStatistic @@ -94,11 +100,12 @@ public: GPUMemoryStatistic GetGPUMemoryStatistic(); #endif -#if defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM) void BeforeRenderFrame(); + void AfterRenderFrame(bool isActiveFrame, m2::PointD const & viewportCenter); + +#if defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM) void BeforeImmediateRendering(); void AfterImmediateRendering(); - void AfterRenderFrame(); #endif struct DrapeStatistic @@ -127,6 +134,8 @@ public: private: DrapeMeasurer() = default; + dp::ApiVersion m_apiVersion = dp::ApiVersion::Invalid; + std::string m_gpuName; bool m_isEnabled = false; #ifdef GENERATING_STATISTIC @@ -153,7 +162,19 @@ private: std::mutex m_tilesMutex; #endif -#ifdef RENDER_STATISTIC + std::chrono::time_point m_startFrameRenderTime; + + std::chrono::nanoseconds m_realtimeMinFrameRenderTime; + std::chrono::nanoseconds m_realtimeMaxFrameRenderTime; + std::chrono::nanoseconds m_realtimeTotalFrameRenderTime; + uint64_t m_realtimeTotalFramesCount = 0; + uint64_t m_realtimeSlowFramesCount = 0; + m2::RectD m_realtimeRenderingBox; + +#if defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM) + std::chrono::nanoseconds m_totalFrameRenderTime; + uint32_t m_totalFramesCount = 0; + std::chrono::nanoseconds m_totalTPF; uint32_t m_totalTPFCount = 0; @@ -162,18 +183,12 @@ private: uint32_t m_totalFPSCount = 0; std::unordered_map m_fpsDistribution; + std::chrono::time_point m_startImmediateRenderingTime; uint32_t m_immediateRenderingMinFps = std::numeric_limits::max(); std::chrono::nanoseconds m_immediateRenderingTimeSum; uint64_t m_immediateRenderingFramesCount = 0; #endif -#if defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM) - std::chrono::time_point m_startFrameRenderTime; - std::chrono::time_point m_startImmediateRenderingTime; - std::chrono::nanoseconds m_totalFrameRenderTime; - uint32_t m_totalFramesCount = 0; -#endif - #ifdef TRACK_GPU_MEM void TakeGPUMemorySnapshot(); diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp index db0ccad393..1fc8d16ce4 100755 --- a/drape_frontend/frontend_renderer.cpp +++ b/drape_frontend/frontend_renderer.cpp @@ -140,7 +140,6 @@ private: #define DEBUG_LABEL(context, labelText) #endif -#if defined(DRAPE_MEASURER) && (defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM)) class DrapeMeasurerGuard { public: @@ -151,10 +150,21 @@ public: ~DrapeMeasurerGuard() { - DrapeMeasurer::Instance().AfterRenderFrame(); + DrapeMeasurer::Instance().AfterRenderFrame(m_isActiveFrame, m_viewportCenter); } + + void SetProperties(bool isActiveFrame, m2::PointD const & viewportCenter) + { + m_isActiveFrame = isActiveFrame; + m_viewportCenter = viewportCenter; + } + +private: + bool m_isActiveFrame = false; + m2::PointD m_viewportCenter = m2::PointD::Zero(); }; +#if defined(DRAPE_MEASURER_BENCHMARK) && (defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM)) class DrapeImmediateRenderingMeasurerGuard { public: @@ -345,7 +355,7 @@ void FrontendRenderer::AcceptMessage(ref_ptr message) if (m_notFinishedTiles.empty()) { -#if defined(DRAPE_MEASURER) && defined(GENERATING_STATISTIC) +#if defined(DRAPE_MEASURER_BENCHMARK) && defined(GENERATING_STATISTIC) DrapeMeasurer::Instance().EndScenePreparing(); #endif m_trafficRenderer->OnGeometryReady(m_currentZoomLevel); @@ -1300,7 +1310,7 @@ void FrontendRenderer::EndUpdateOverlayTree() void FrontendRenderer::RenderScene(ScreenBase const & modelView, bool activeFrame) { CHECK(m_context != nullptr, ()); -#if defined(DRAPE_MEASURER) && (defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM)) +#if defined(DRAPE_MEASURER_BENCHMARK) && (defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM)) DrapeImmediateRenderingMeasurerGuard drapeMeasurerGuard(m_context); #endif @@ -1607,9 +1617,7 @@ void FrontendRenderer::RenderEmptyFrame() void FrontendRenderer::RenderFrame() { -#if defined(DRAPE_MEASURER) && (defined(RENDER_STATISTIC) || defined(TRACK_GPU_MEM)) DrapeMeasurerGuard drapeMeasurerGuard; -#endif CHECK(m_context != nullptr, ()); if (!m_context->Validate()) @@ -1650,6 +1658,10 @@ void FrontendRenderer::RenderFrame() m_frameData.m_framesFast += static_cast(!isActiveFrameForScene); #endif +#ifndef DRAPE_MEASURER_BENCHMARK + drapeMeasurerGuard.SetProperties(isActiveFrameForScene, modelView.GetOrg()); +#endif + RenderScene(modelView, isActiveFrameForScene); auto const hasForceUpdate = m_forceUpdateScene || m_forceUpdateUserMarks; @@ -2081,7 +2093,7 @@ TTilesCollection FrontendRenderer::ResolveTileKeys(ScreenBase const & screen) m_trafficRenderer->OnUpdateViewport(result, m_currentZoomLevel, tilesToDelete); -#if defined(DRAPE_MEASURER) && defined(GENERATING_STATISTIC) +#if defined(DRAPE_MEASURER_BENCHMARK) && defined(GENERATING_STATISTIC) DrapeMeasurer::Instance().StartScenePreparing(); #endif @@ -2194,6 +2206,20 @@ void FrontendRenderer::OnContextCreate() m_transitBackground = make_unique_dp(m_context); } +void FrontendRenderer::OnRenderingEnabled() +{ +#ifndef DRAPE_MEASURER_BENCHMARK + DrapeMeasurer::Instance().Start(); +#endif +} + +void FrontendRenderer::OnRenderingDisabled() +{ +#ifndef DRAPE_MEASURER_BENCHMARK + DrapeMeasurer::Instance().Stop(); +#endif +} + FrontendRenderer::Routine::Routine(FrontendRenderer & renderer) : m_renderer(renderer) {} void FrontendRenderer::Routine::Do() @@ -2221,11 +2247,19 @@ void FrontendRenderer::Routine::Do() }); #endif +#ifndef DRAPE_MEASURER_BENCHMARK + DrapeMeasurer::Instance().SetApiVersion(m_renderer.m_apiVersion); + DrapeMeasurer::Instance().SetGpuName(m_renderer.m_context->GetRendererName()); + DrapeMeasurer::Instance().Start(); +#endif while (!IsCancelled()) { RENDER_FRAME(m_renderer.RenderFrame()); m_renderer.CheckRenderingEnabled(); } +#ifndef DRAPE_MEASURER_BENCHMARK + DrapeMeasurer::Instance().Stop(true /* forceProcessRealtimeStats */); +#endif m_renderer.CollectShowOverlaysEvents(); m_renderer.ReleaseResources(); diff --git a/drape_frontend/frontend_renderer.hpp b/drape_frontend/frontend_renderer.hpp index 98b8d888f2..479825c613 100755 --- a/drape_frontend/frontend_renderer.hpp +++ b/drape_frontend/frontend_renderer.hpp @@ -141,6 +141,9 @@ protected: void OnContextCreate() override; void OnContextDestroy() override; + void OnRenderingEnabled() override; + void OnRenderingDisabled() override; + private: void OnResize(ScreenBase const & screen); void RenderScene(ScreenBase const & modelView, bool activeFrame); diff --git a/drape_frontend/tile_info.cpp b/drape_frontend/tile_info.cpp index e3b10f1cad..7762b4f2f6 100644 --- a/drape_frontend/tile_info.cpp +++ b/drape_frontend/tile_info.cpp @@ -55,7 +55,7 @@ void TileInfo::ReadFeatureIndex(MapDataProvider const & model) void TileInfo::ReadFeatures(MapDataProvider const & model) { -#if defined(DRAPE_MEASURER) && defined(TILES_STATISTIC) +#if defined(DRAPE_MEASURER_BENCHMARK) && defined(TILES_STATISTIC) DrapeMeasurer::Instance().StartTileReading(); #endif m_context->BeginReadTile(); @@ -77,7 +77,7 @@ void TileInfo::ReadFeatures(MapDataProvider const & model) model.GetFilter(), make_ref(m_context)); model.ReadFeatures(std::bind(std::ref(drawer), _1), m_featureInfo); } -#if defined(DRAPE_MEASURER) && defined(TILES_STATISTIC) +#if defined(DRAPE_MEASURER_BENCHMARK) && defined(TILES_STATISTIC) DrapeMeasurer::Instance().EndTileReading(); #endif } diff --git a/map/benchmark_tools.cpp b/map/benchmark_tools.cpp index 1e7c91d92e..05bf18c408 100644 --- a/map/benchmark_tools.cpp +++ b/map/benchmark_tools.cpp @@ -31,7 +31,7 @@ struct BenchmarkHandle std::vector m_regionsToDownload; size_t m_regionsToDownloadCounter = 0; -#ifdef DRAPE_MEASURER +#ifdef DRAPE_MEASURER_BENCHMARK std::vector> m_drapeStatistic; #endif }; @@ -40,7 +40,7 @@ void RunScenario(Framework * framework, std::shared_ptr handle) { if (handle->m_currentScenario >= handle->m_scenariosToRun.size()) { -#ifdef DRAPE_MEASURER +#ifdef DRAPE_MEASURER_BENCHMARK for (auto const & it : handle->m_drapeStatistic) { LOG(LINFO, ("\n ***** Report for scenario", it.first, "*****\n", @@ -57,14 +57,14 @@ void RunScenario(Framework * framework, std::shared_ptr handle) framework->GetDrapeEngine()->RunScenario(std::move(scenarioData), [handle](std::string const & name) { -#ifdef DRAPE_MEASURER - df::DrapeMeasurer::Instance().StartBenchmark(); +#ifdef DRAPE_MEASURER_BENCHMARK + df::DrapeMeasurer::Instance().Start(); #endif }, [framework, handle](std::string const & name) { -#ifdef DRAPE_MEASURER - df::DrapeMeasurer::Instance().StopBenchmark(); +#ifdef DRAPE_MEASURER_BENCHMARK + df::DrapeMeasurer::Instance().Stop(); auto const drapeStatistic = df::DrapeMeasurer::Instance().GetDrapeStatistic(); handle->m_drapeStatistic.push_back(make_pair(name, drapeStatistic)); #endif diff --git a/platform/http_user_agent.hpp b/platform/http_user_agent.hpp index 8636edcc0b..24179eb76b 100644 --- a/platform/http_user_agent.hpp +++ b/platform/http_user_agent.hpp @@ -9,6 +9,7 @@ class HttpUserAgent public: HttpUserAgent(); std::string Get() const; + std::string const & GetAppVersion() const { return m_appVersion; } operator std::string() const { return Get(); }