MCPcopy Create free account
hub / github.com/apache/impala / ResultString

Function ResultString

be/src/benchmarks/hash-table-benchmark.cc:290–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288
289using namespace htbenchmark;
290std::string ResultString(
291 vector<std::string> benchmark_names, vector<int64_t> memory_consumption) {
292 stringstream ss;
293 int function_out_width = 50;
294 int mem_width = 20;
295 int total_width = function_out_width + mem_width;
296 std::string name("Hash Table Memory Consumption");
297 ss << name << ":" << setw(function_out_width - name.size() - 1) << "Function"
298 << setw(mem_width) << "Bytes Consumed" << std::endl;
299 for (int i = 0; i < total_width; ++i) {
300 ss << '-';
301 }
302 ss << std::endl;
303 for (int i = 0; i < benchmark_names.size(); i++) {
304 ss << setw(function_out_width) << benchmark_names[i] << setw(mem_width)
305 << memory_consumption[i] << std::endl;
306 }
307 return ss.str();
308}
309
310int64_t GetMemoryBytesConsumed(HashTable* ht) {
311 int empty_buckets = ht->EmptyBuckets();

Callers 1

mainFunction · 0.85

Calls 2

sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected