Files
comaps/openlr/stats.hpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

49 lines
1.3 KiB
C++

#pragma once
#include "openlr/cache_line_size.hpp"
#include "base/logging.hpp"
#include <chrono>
#include <cstdint>
namespace openlr
{
namespace v2
{
struct alignas(kCacheLineSize) Stats
{
void Add(Stats const & s)
{
m_routesHandled += s.m_routesHandled;
m_routesFailed += s.m_routesFailed;
m_noCandidateFound += s.m_noCandidateFound;
m_noShortestPathFound += s.m_noShortestPathFound;
m_notEnoughScore += s.m_notEnoughScore;
m_wrongOffsets += s.m_wrongOffsets;
m_zeroDistToNextPointCount += s.m_zeroDistToNextPointCount;
}
void Report() const
{
LOG(LINFO, ("Total routes handled:", m_routesHandled));
LOG(LINFO, ("Failed:", m_routesFailed));
LOG(LINFO, ("No candidate lines:", m_noCandidateFound));
LOG(LINFO, ("Wrong distance to next point:", m_zeroDistToNextPointCount));
LOG(LINFO, ("Not enough score for shortest path:", m_notEnoughScore));
LOG(LINFO, ("Wrong offsets:", m_wrongOffsets));
LOG(LINFO, ("No shortest path:", m_noShortestPathFound));
}
uint32_t m_routesHandled = 0;
uint32_t m_routesFailed = 0;
uint32_t m_noCandidateFound = 0;
uint32_t m_noShortestPathFound = 0;
uint32_t m_notEnoughScore = 0;
uint32_t m_wrongOffsets = 0;
// Number of zeroed distance-to-next point values in the input.
uint32_t m_zeroDistToNextPointCount = 0;
};
} // namespace V2
} // namespace openlr