diff options
author | vng <viktor.govako@gmail.com> | 2014-09-20 17:22:09 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:28:32 +0300 |
commit | 8d367208c6fd8dcbb7e30b806c8e17c28d1ac69d (patch) | |
tree | b2ebdc03146485cb21dcc45b9cfeac064b466ccf /generator/statistics.cpp | |
parent | f8da9e5245f631676de4c6572606d3e24d1b1b69 (diff) |
[generator] Added statistics for routing container.
Diffstat (limited to 'generator/statistics.cpp')
-rw-r--r-- | generator/statistics.cpp | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/generator/statistics.cpp b/generator/statistics.cpp index 339e1796d6..ab9e7ad0e9 100644 --- a/generator/statistics.cpp +++ b/generator/statistics.cpp @@ -8,6 +8,7 @@ #include "../indexer/data_factory.hpp" #include "../base/string_utils.hpp" +#include "../base/logging.hpp" #include "../std/iostream.hpp" #include "../std/iomanip.hpp" @@ -19,41 +20,17 @@ namespace stats { void FileContainerStatistic(string const & fPath) { - feature::DataHeader header; - ModelReaderPtr reader(new FileReader(fPath)); - LoadMapHeader(reader, header); - - vector<string> tags; - tags.push_back(VERSION_FILE_TAG); - tags.push_back(HEADER_FILE_TAG); - tags.push_back(DATA_FILE_TAG); - - cout << "Geometry zoom levels: "; - for (size_t i = 0; i < header.GetScalesCount(); ++i) + try { - cout << header.GetScale(i) << " "; - - tags.push_back(feature::GetTagForIndex(GEOMETRY_FILE_TAG, i)); - tags.push_back(feature::GetTagForIndex(TRIANGLE_FILE_TAG, i)); + FilesContainerR cont(fPath); + cont.ForEachTag([&cont] (FilesContainerR::Tag const & tag) + { + cout << setw(10) << tag << " : " << cont.GetReader(tag).Size() << endl; + }); } - - cout << endl; - - tags.push_back(INDEX_FILE_TAG); - tags.push_back(SEARCH_INDEX_FILE_TAG); - - FilesContainerR cont(reader); - for (size_t i = 0; i < tags.size(); ++i) + catch (Reader::Exception const & ex) { - cout << setw(7) << tags[i] << " : "; - try - { - cout << cont.GetReader(tags[i]).Size() << endl; - } - catch (Reader::Exception const &) - { - cout << '-' << endl; - } + LOG(LWARNING, ("Error reading file:", fPath, ex.Msg())); } } |