xapian-core
1.4.26
|
#include <perftest.h>
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 > ¶ms) |
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 |
Definition at line 32 of file perftest.h.
PerfTestLogger::PerfTestLogger | ( | ) |
Definition at line 81 of file perftest.cc.
PerfTestLogger::~PerfTestLogger | ( | ) |
Definition at line 87 of file perftest.cc.
References close().
void PerfTestLogger::close | ( | ) |
Flush and close the log file.
Definition at line 283 of file perftest.cc.
References out, repetition_end(), and write().
Referenced by ~PerfTestLogger().
void PerfTestLogger::indexing_add | ( | ) |
Log the addition of a document in an indexing run.
Definition at line 338 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().
void PerfTestLogger::indexing_begin | ( | const std::string & | dbname, |
const std::map< std::string, std::string > & | params | ||
) |
Log the start of an indexing run.
Definition at line 293 of file perftest.cc.
References escape_xml(), indexing_addcount, indexing_end(), indexing_log(), indexing_started, indexing_timer, indexing_unlogged_changes, last_indexlog_timer, RealTime::now(), searching_end(), Xapian::Internal::str(), and write().
Referenced by builddb_valuestest1(), and DEFINE_TESTCASE().
void PerfTestLogger::indexing_end | ( | ) |
Log the end of an indexing run.
Definition at line 354 of file perftest.cc.
References indexing_log(), indexing_started, and write().
Referenced by builddb_valuestest1(), DEFINE_TESTCASE(), indexing_begin(), searching_start(), and testcase_end().
|
private |
Write a log entry for the current indexing run.
Definition at line 325 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().
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 237 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().
void PerfTestLogger::repetition_begin | ( | int | num | ) |
Start a repetition of the tests.
Definition at line 429 of file perftest.cc.
References repetition_end(), and repetition_number.
Referenced by PerfTestRunner::run().
void PerfTestLogger::repetition_end | ( | ) |
End a repetition of the tests.
Definition at line 436 of file perftest.cc.
References testcase_end().
Referenced by close(), repetition_begin(), and PerfTestRunner::run().
void PerfTestLogger::search_end | ( | const Xapian::Query & | query, |
const Xapian::MSet & | mset | ||
) |
Log the completion of a search.
Definition at line 381 of file perftest.cc.
References Assert, escape_xml(), Xapian::Query::get_description(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), RealTime::now(), search_start(), searching_started, searching_timer, Xapian::MSet::size(), Xapian::Internal::str(), and write().
Referenced by DEFINE_TESTCASE().
void PerfTestLogger::search_start | ( | ) |
Log the start of a search.
Definition at line 375 of file perftest.cc.
References RealTime::now(), and searching_timer.
Referenced by DEFINE_TESTCASE(), search_end(), and searching_start().
void PerfTestLogger::searching_end | ( | ) |
Log the end of a search run.
Definition at line 400 of file perftest.cc.
References searching_started, and write().
Referenced by DEFINE_TESTCASE(), indexing_begin(), and searching_start().
void PerfTestLogger::searching_start | ( | const std::string & | description | ) |
Log the start of a search run.
Definition at line 364 of file perftest.cc.
References escape_xml(), indexing_end(), search_start(), searching_end(), searching_started, and write().
Referenced by DEFINE_TESTCASE().
void PerfTestLogger::testcase_begin | ( | const std::string & | testcase | ) |
Start a testcase.
Definition at line 409 of file perftest.cc.
References backendmanager, BackendManager::get_dbtype(), repetition_number, Xapian::Internal::str(), testcase_end(), testcase_started, and write().
Referenced by builddb_valuestest1(), and DEFINE_TESTCASE().
void PerfTestLogger::testcase_end | ( | ) |
End a testcase.
Definition at line 419 of file perftest.cc.
References indexing_end(), testcase_started, and write().
Referenced by builddb_valuestest1(), DEFINE_TESTCASE(), repetition_end(), and testcase_begin().
|
private |
Definition at line 276 of file perftest.cc.
References out.
Referenced by close(), indexing_begin(), indexing_end(), indexing_log(), open(), search_end(), searching_end(), searching_start(), testcase_begin(), and testcase_end().
|
private |
Definition at line 40 of file perftest.h.
Referenced by indexing_add(), indexing_begin(), and indexing_log().
|
private |
Definition at line 39 of file perftest.h.
Referenced by indexing_begin(), indexing_end(), and indexing_log().
|
private |
Definition at line 42 of file perftest.h.
Referenced by indexing_begin(), and indexing_log().
|
private |
Definition at line 41 of file perftest.h.
Referenced by indexing_add(), indexing_begin(), and indexing_log().
|
private |
Definition at line 43 of file perftest.h.
Referenced by indexing_add(), indexing_begin(), and indexing_log().
|
private |
Definition at line 33 of file perftest.h.
|
private |
Definition at line 35 of file perftest.h.
Referenced by repetition_begin(), and testcase_begin().
|
private |
Definition at line 45 of file perftest.h.
Referenced by search_end(), searching_end(), and searching_start().
|
private |
Definition at line 46 of file perftest.h.
Referenced by search_end(), and search_start().
|
private |
Definition at line 37 of file perftest.h.
Referenced by testcase_begin(), and testcase_end().