MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / appendOrIncrementEntry

Function appendOrIncrementEntry

src/function/table/disk_size_info.cpp:124–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122};
123
124static 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
138static std::vector<DiskSizeEntry> collectDiskSizeInfo(const ClientContext* context) {
139 std::vector<DiskSizeEntry> entries;

Callers 1

collectDiskSizeInfoFunction · 0.85

Calls 4

containsMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected