diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-10-09 16:12:02 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-10-10 19:54:51 +0300 |
commit | a9f06f3b527601fc0d7a1c254af414e7a313eef0 (patch) | |
tree | 6948a3dbc0553f18566c90c7c04d300896d80d73 /render-test/metadata.hpp | |
parent | 026e15fe3d6dae0c3f11775d19dcfc13743ff1c0 (diff) | |
download | qtlocation-mapboxgl-a9f06f3b527601fc0d7a1c254af414e7a313eef0.tar.gz |
[render-test] Add instruction for verifying file size
For a given absolute or relative path, measure the size of the file.
This is useful for measuring if the cache has increased as expected
after moving a camera or decreased after cleaning up.
In a more hackish manner, could be used for collecting binary size
statistics of shared libraries.
Diffstat (limited to 'render-test/metadata.hpp')
-rw-r--r-- | render-test/metadata.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/render-test/metadata.hpp b/render-test/metadata.hpp index d25b81c7ab..e881bce208 100644 --- a/render-test/metadata.hpp +++ b/render-test/metadata.hpp @@ -31,6 +31,14 @@ struct TestPaths { } }; +struct FileSizeProbe { + FileSizeProbe() = default; + FileSizeProbe(std::string path_, uintmax_t size_) : path(std::move(path_)), size(size_) {} + + std::string path; + uintmax_t size; +}; + struct MemoryProbe { MemoryProbe() = default; MemoryProbe(size_t peak_, size_t allocations_) @@ -43,7 +51,8 @@ struct MemoryProbe { class TestMetrics { public: - bool isEmpty() const { return memory.empty(); } + bool isEmpty() const { return fileSize.empty() && memory.empty(); } + std::map<std::string, FileSizeProbe> fileSize; std::map<std::string, MemoryProbe> memory; }; |