| 122 | }; |
| 123 | |
| 124 | static void appendOrIncrementEntry(std::vector<DiskSizeEntry>& entries, |
| 125 | std::unordered_map<std::string, idx_t>& entryLookup, std::string category, std::string name, |
| 126 | uint64_t numPages) { |
| 127 | const auto key = category + "\n" + name; |
| 128 | if (entryLookup.contains(key)) { |
| 129 | auto& entry = entries[entryLookup.at(key)]; |
| 130 | entry.numPages += numPages; |
| 131 | entry.sizeBytes += numPages * LBUG_PAGE_SIZE; |
| 132 | return; |
| 133 | } |
| 134 | entryLookup.insert({key, entries.size()}); |
| 135 | entries.push_back({std::move(category), std::move(name), numPages, numPages * LBUG_PAGE_SIZE}); |
| 136 | } |
| 137 | |
| 138 | static std::vector<DiskSizeEntry> collectDiskSizeInfo(const ClientContext* context) { |
| 139 | std::vector<DiskSizeEntry> entries; |
no test coverage detected