xapian-core  1.4.19
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PerfTestLogger Class Reference

#include <perftest.h>

+ Collaboration diagram for PerfTestLogger:

Public Member Functions

 PerfTestLogger ()
 
 ~PerfTestLogger ()
 
bool open (const std::string &logpath)
 Open a file to log to. More...
 
void close ()
 Flush and close the log file. More...
 
void indexing_begin (const std::string &dbname, const std::map< std::string, std::string > &params)
 Log the start of an indexing run. More...
 
void indexing_add ()
 Log the addition of a document in an indexing run. More...
 
void indexing_end ()
 Log the end of an indexing run. More...
 
void searching_start (const std::string &description)
 Log the start of a search run. More...
 
void search_start ()
 Log the start of a search. More...
 
void search_end (const Xapian::Query &query, const Xapian::MSet &mset)
 Log the completion of a search. More...
 
void searching_end ()
 Log the end of a search run. More...
 
void testcase_begin (const std::string &testcase)
 Start a testcase. More...
 
void testcase_end ()
 End a testcase. More...
 
void repetition_begin (int num)
 Start a repetition of the tests. More...
 
void repetition_end ()
 End a repetition of the tests. More...
 

Private Member Functions

void indexing_log ()
 Write a log entry for the current indexing run. More...
 
void write (const std::string &text)
 

Private Attributes

std::ofstream out
 
int repetition_number
 
bool testcase_started
 
bool indexing_started
 
Xapian::doccount indexing_addcount
 
bool indexing_unlogged_changes
 
double indexing_timer
 
double last_indexlog_timer
 
bool searching_started
 
double searching_timer
 

Detailed Description

Definition at line 32 of file perftest.h.

Constructor & Destructor Documentation

◆ PerfTestLogger()

PerfTestLogger::PerfTestLogger ( )

Definition at line 81 of file perftest.cc.

◆ ~PerfTestLogger()

PerfTestLogger::~PerfTestLogger ( )

Definition at line 87 of file perftest.cc.

References close().

Member Function Documentation

◆ close()

void PerfTestLogger::close ( )

Flush and close the log file.

Definition at line 274 of file perftest.cc.

References out, repetition_end(), and write().

Referenced by ~PerfTestLogger().

◆ indexing_add()

void PerfTestLogger::indexing_add ( )

Log the addition of a document in an indexing run.

Definition at line 329 of file perftest.cc.

References indexing_addcount, indexing_log(), indexing_unlogged_changes, last_indexlog_timer, and RealTime::now().

Referenced by builddb_valuestest1(), and DEFINE_TESTCASE().

◆ indexing_begin()

void PerfTestLogger::indexing_begin ( const std::string &  dbname,
const std::map< std::string, std::string > &  params 
)

◆ indexing_end()

void PerfTestLogger::indexing_end ( )

Log the end of an indexing run.

Definition at line 345 of file perftest.cc.

References indexing_log(), indexing_started, and write().

Referenced by builddb_valuestest1(), DEFINE_TESTCASE(), indexing_begin(), searching_start(), and testcase_end().

◆ indexing_log()

void PerfTestLogger::indexing_log ( )
private

Write a log entry for the current indexing run.

Definition at line 316 of file perftest.cc.

References Assert, indexing_addcount, indexing_started, indexing_timer, indexing_unlogged_changes, last_indexlog_timer, RealTime::now(), Xapian::Internal::str(), and write().

Referenced by indexing_add(), indexing_begin(), and indexing_end().

◆ open()

bool PerfTestLogger::open ( const std::string &  logpath)

Open a file to log to.

Returns false if the file can't be opened.

Definition at line 228 of file perftest.cc.

References get_commit_ref(), get_distro(), get_hostname(), get_loadavg(), get_ncpus(), get_total_physical_memory(), out, Xapian::Internal::str(), Xapian::version_string(), and write().

Referenced by main().

◆ repetition_begin()

void PerfTestLogger::repetition_begin ( int  num)

Start a repetition of the tests.

Definition at line 420 of file perftest.cc.

References repetition_end(), and repetition_number.

Referenced by PerfTestRunner::run().

◆ repetition_end()

void PerfTestLogger::repetition_end ( )

End a repetition of the tests.

Definition at line 427 of file perftest.cc.

References testcase_end().

Referenced by close(), repetition_begin(), and PerfTestRunner::run().

◆ search_end()

void PerfTestLogger::search_end ( const Xapian::Query query,
const Xapian::MSet mset 
)

◆ search_start()

void PerfTestLogger::search_start ( )

Log the start of a search.

Definition at line 366 of file perftest.cc.

References RealTime::now(), and searching_timer.

Referenced by DEFINE_TESTCASE(), search_end(), and searching_start().

◆ searching_end()

void PerfTestLogger::searching_end ( )

Log the end of a search run.

Definition at line 391 of file perftest.cc.

References searching_started, and write().

Referenced by DEFINE_TESTCASE(), indexing_begin(), and searching_start().

◆ searching_start()

void PerfTestLogger::searching_start ( const std::string &  description)

Log the start of a search run.

Definition at line 355 of file perftest.cc.

References escape_xml(), indexing_end(), search_start(), searching_end(), searching_started, and write().

Referenced by DEFINE_TESTCASE().

◆ testcase_begin()

void PerfTestLogger::testcase_begin ( const std::string &  testcase)

◆ testcase_end()

void PerfTestLogger::testcase_end ( )

End a testcase.

Definition at line 410 of file perftest.cc.

References indexing_end(), testcase_started, and write().

Referenced by builddb_valuestest1(), DEFINE_TESTCASE(), repetition_end(), and testcase_begin().

◆ write()

void PerfTestLogger::write ( const std::string &  text)
private

Member Data Documentation

◆ indexing_addcount

Xapian::doccount PerfTestLogger::indexing_addcount
private

Definition at line 40 of file perftest.h.

Referenced by indexing_add(), indexing_begin(), and indexing_log().

◆ indexing_started

bool PerfTestLogger::indexing_started
private

Definition at line 39 of file perftest.h.

Referenced by indexing_begin(), indexing_end(), and indexing_log().

◆ indexing_timer

double PerfTestLogger::indexing_timer
private

Definition at line 42 of file perftest.h.

Referenced by indexing_begin(), and indexing_log().

◆ indexing_unlogged_changes

bool PerfTestLogger::indexing_unlogged_changes
private

Definition at line 41 of file perftest.h.

Referenced by indexing_add(), indexing_begin(), and indexing_log().

◆ last_indexlog_timer

double PerfTestLogger::last_indexlog_timer
private

Definition at line 43 of file perftest.h.

Referenced by indexing_add(), indexing_begin(), and indexing_log().

◆ out

std::ofstream PerfTestLogger::out
private

Definition at line 33 of file perftest.h.

Referenced by close(), open(), and write().

◆ repetition_number

int PerfTestLogger::repetition_number
private

Definition at line 35 of file perftest.h.

Referenced by repetition_begin(), and testcase_begin().

◆ searching_started

bool PerfTestLogger::searching_started
private

Definition at line 45 of file perftest.h.

Referenced by search_end(), searching_end(), and searching_start().

◆ searching_timer

double PerfTestLogger::searching_timer
private

Definition at line 46 of file perftest.h.

Referenced by search_end(), and search_start().

◆ testcase_started

bool PerfTestLogger::testcase_started
private

Definition at line 37 of file perftest.h.

Referenced by testcase_begin(), and testcase_end().


The documentation for this class was generated from the following files: