From 135c1fa3063fa98006cfc5aa257cfa15b05082eb Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Thu, 25 Feb 2016 17:25:23 +0100 Subject: [PATCH] tests: memory_footprint: Report size in query results --- tests/memory_footprint.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/memory_footprint.cc b/tests/memory_footprint.cc index 4d44ffbbec..b88b548562 100644 --- a/tests/memory_footprint.cc +++ b/tests/memory_footprint.cc @@ -25,6 +25,7 @@ #include #include +#include "partition_slice_builder.hh" #include "schema_builder.hh" #include "memtable.hh" #include "row_cache.hh" @@ -160,6 +161,7 @@ struct sizes { size_t sstable; size_t frozen; size_t canonical; + size_t query_result; }; static sizes calculate_sizes(const mutation& m) { @@ -179,6 +181,7 @@ static sizes calculate_sizes(const mutation& m) { result.cache = tracker.region().occupancy().used_space(); result.frozen = freeze(m).representation().size(); result.canonical = canonical_mutation(m).representation().size(); + result.query_result = m.query(partition_slice_builder(*s).build()).buf().size(); tmpdir sstable_dir; auto sst = make_lw_shared(s->ks_name(), s->cf_name(), @@ -218,11 +221,12 @@ int main(int argc, char** argv) { auto sizes = calculate_sizes(m); std::cout << "mutation footprint:" << "\n"; - std::cout << " - in cache: " << sizes.cache << "\n"; - std::cout << " - in memtable: " << sizes.memtable << "\n"; - std::cout << " - in sstable: " << sizes.sstable << "\n"; - std::cout << " - frozen: " << sizes.frozen << "\n"; - std::cout << " - canonical: " << sizes.canonical << "\n"; + std::cout << " - in cache: " << sizes.cache << "\n"; + std::cout << " - in memtable: " << sizes.memtable << "\n"; + std::cout << " - in sstable: " << sizes.sstable << "\n"; + std::cout << " - frozen: " << sizes.frozen << "\n"; + std::cout << " - canonical: " << sizes.canonical << "\n"; + std::cout << " - query result: " << sizes.query_result << "\n"; std::cout << "\n"; size_calculator::print_cache_entry_size();