MCPcopy Create free account
hub / github.com/comaps/comaps / RunScenario

Function RunScenario

libs/map/benchmark_tools.cpp:56–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54};
55
56void RunScenario(Framework * framework, std::shared_ptr<BenchmarkHandle> handle)
57{
58 if (handle->m_currentScenario >= handle->m_scenariosToRun.size())
59 {
60#ifdef DRAPE_MEASURER_BENCHMARK
61 for (auto const & it : handle->m_drapeStatistic)
62 {
63 LOG(LINFO, ("\n ***** Report for scenario", it.first, "*****\n", it.second.ToString(),
64 "\n ***** Report for scenario", it.first, "*****\n"));
65 }
66#endif
67 return;
68 }
69
70 auto & scenarioData = handle->m_scenariosToRun[handle->m_currentScenario];
71
72 framework->GetDrapeEngine()->RunScenario(std::move(scenarioData),
73 [handle](std::string const & name)
74 {
75#ifdef DRAPE_MEASURER_BENCHMARK
76 df::DrapeMeasurer::Instance().Start();
77#endif
78 }, [framework, handle](std::string const & name)
79 {
80#ifdef DRAPE_MEASURER_BENCHMARK
81 df::DrapeMeasurer::Instance().Stop();
82 auto const drapeStatistic = df::DrapeMeasurer::Instance().GetDrapeStatistic();
83 handle->m_drapeStatistic.push_back(make_pair(name, drapeStatistic));
84#endif
85 GetPlatform().RunTask(Platform::Thread::Gui, [framework, handle]()
86 {
87 handle->m_currentScenario++;
88 RunScenario(framework, handle);
89 });
90 });
91}
92} // namespace
93
94namespace benchmark

Callers 1

RunGraphicsBenchmarkFunction · 0.85

Calls 9

GetDrapeEngineMethod · 0.80
GetDrapeStatisticMethod · 0.80
RunTaskMethod · 0.80
sizeMethod · 0.45
ToStringMethod · 0.45
RunScenarioMethod · 0.45
StartMethod · 0.45
StopMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected