Skip to content

Commit c0f8ea4

Browse files
committed
Remove debug codes
Signed-off-by: JaySon-Huang <[email protected]>
1 parent c68cabc commit c0f8ea4

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

dbms/src/Storages/DeltaMerge/tests/gtest_segment.cpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -607,58 +607,6 @@ try
607607
}
608608
CATCH
609609

610-
namespace
611-
{
612-
struct ProcessMemoryUsage
613-
{
614-
double resident_mb;
615-
Int64 cur_proc_num_threads;
616-
double cur_virt_mb;
617-
};
618-
619-
bool process_mem_usage(double & resident_set, Int64 & cur_proc_num_threads, UInt64 & cur_virt_size)
620-
{
621-
resident_set = 0.0;
622-
623-
// 'file' stat seems to give the most reliable results
624-
std::ifstream stat_stream("/proc/self/stat", std::ios_base::in);
625-
// if "/proc/self/stat" is not supported
626-
if (!stat_stream.is_open())
627-
return false;
628-
629-
// dummy vars for leading entries in stat that we don't care about
630-
std::string pid, comm, state, ppid, pgrp, session, tty_nr;
631-
std::string tpgid, flags, minflt, cminflt, majflt, cmajflt;
632-
std::string utime, stime, cutime, cstime, priority, nice;
633-
std::string itrealvalue, starttime;
634-
635-
// the field we want
636-
Int64 rss;
637-
638-
stat_stream >> pid >> comm >> state >> ppid >> pgrp >> session >> tty_nr >> tpgid >> flags >> minflt >> cminflt
639-
>> majflt >> cmajflt >> utime >> stime >> cutime >> cstime >> priority >> nice >> cur_proc_num_threads
640-
>> itrealvalue >> starttime >> cur_virt_size >> rss; // don't care about the rest
641-
642-
stat_stream.close();
643-
644-
Int64 page_size_kb = sysconf(_SC_PAGE_SIZE) / 1024; // in case x86-64 is configured to use 2MB pages
645-
resident_set = rss * page_size_kb;
646-
return true;
647-
}
648-
ProcessMemoryUsage get_process_mem_usage()
649-
{
650-
double resident_set;
651-
Int64 cur_proc_num_threads = 1;
652-
UInt64 cur_virt_size = 0;
653-
process_mem_usage(resident_set, cur_proc_num_threads, cur_virt_size);
654-
resident_set *= 1024; // unit: byte
655-
return ProcessMemoryUsage{
656-
resident_set / 1024.0 / 1024,
657-
cur_proc_num_threads,
658-
cur_virt_size / 1024.0 / 1024,
659-
};
660-
}
661-
} // namespace
662610

663611
class SegmentEnableLogicalSplitTest : public SegmentOperationTest
664612
{

0 commit comments

Comments
 (0)