diff options
author | Ilya Zverev <zverik@textual.ru> | 2015-09-12 16:03:10 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:05:00 +0300 |
commit | c54944d79419888debe327e4244eb1e16ad85027 (patch) | |
tree | 9a1bf26a0fc489d6efdb50ea0f11991836a7b129 /generator/statistics.hpp | |
parent | 480a748695739a51219ad09b0adc9d7d75024647 (diff) |
[stats] type_statistics key for generator_tool, better area calculation
Diffstat (limited to 'generator/statistics.hpp')
-rw-r--r-- | generator/statistics.hpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/generator/statistics.hpp b/generator/statistics.hpp index 968777fd35..9240374ace 100644 --- a/generator/statistics.hpp +++ b/generator/statistics.hpp @@ -10,15 +10,18 @@ namespace stats struct GeneralInfo { uint64_t m_count, m_size; + double m_length, m_area; - GeneralInfo() : m_count(0), m_size(0) {} + GeneralInfo() : m_count(0), m_size(0), m_length(0), m_area(0) {} - void Add(uint64_t sz) + void Add(uint64_t szBytes, double len = 0, double area = 0) { - if (sz > 0) + if (szBytes > 0) { ++m_count; - m_size += sz; + m_size += szBytes; + m_length += len; + m_area += area; } } }; @@ -43,17 +46,11 @@ namespace stats map<AreaType, GeneralInfo> m_byAreaSize; GeneralInfo m_inner[3]; - - template <class TKey, class TSet> - void AddToSet(TKey key, uint32_t sz, TSet & theSet) - { - if (sz > 0) - theSet[key].Add(sz); - } }; void FileContainerStatistic(string const & fPath); void CalcStatistic(string const & fPath, MapInfo & info); void PrintStatistic(MapInfo & info); + void PrintTypeStatistic(MapInfo & info); } |