xapian-core  1.4.25
perftest.h
Go to the documentation of this file.
1 
4 /* Copyright 2008 Lemur Consulting Ltd
5  * Copyright 2010 Olly Betts
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef XAPIAN_INCLUDED_PERFTEST_H
24 #define XAPIAN_INCLUDED_PERFTEST_H
25 
26 #include <xapian.h>
27 
28 #include <fstream>
29 #include <map>
30 #include <string>
31 
33  std::ofstream out;
34 
36 
38 
44 
47 
50  void indexing_log();
51 
52  void write(const std::string & text);
53 
54  public:
57 
62  bool open(const std::string & logpath);
63 
66  void close();
67 
70  void indexing_begin(const std::string & dbname,
71  const std::map<std::string, std::string> & params);
72 
75  void indexing_add();
76 
79  void indexing_end();
80 
83  void searching_start(const std::string & description);
84 
87  void search_start();
88 
91  void search_end(const Xapian::Query & query,
92  const Xapian::MSet & mset);
93 
96  void searching_end();
97 
100  void testcase_begin(const std::string & testcase);
101 
104  void testcase_end();
105 
108  void repetition_begin(int num);
109 
112  void repetition_end();
113 };
114 
115 extern PerfTestLogger logger;
116 
117 #endif // XAPIAN_INCLUDED_PERFTEST_H
bool searching_started
Definition: perftest.h:45
void searching_start(const std::string &description)
Log the start of a search run.
Definition: perftest.cc:364
void repetition_begin(int num)
Start a repetition of the tests.
Definition: perftest.cc:429
void search_start()
Log the start of a search.
Definition: perftest.cc:375
std::ofstream out
Definition: perftest.h:33
void indexing_add()
Log the addition of a document in an indexing run.
Definition: perftest.cc:338
Class representing a list of search results.
Definition: mset.h:44
bool indexing_unlogged_changes
Definition: perftest.h:41
Xapian::doccount indexing_addcount
Definition: perftest.h:40
double searching_timer
Definition: perftest.h:46
double indexing_timer
Definition: perftest.h:42
void testcase_begin(const std::string &testcase)
Start a testcase.
Definition: perftest.cc:409
bool indexing_started
Definition: perftest.h:39
Public interfaces for the Xapian library.
bool open(const std::string &logpath)
Open a file to log to.
Definition: perftest.cc:237
void indexing_end()
Log the end of an indexing run.
Definition: perftest.cc:354
bool testcase_started
Definition: perftest.h:37
void close()
Flush and close the log file.
Definition: perftest.cc:283
static Xapian::Query query(Xapian::Query::op op, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string())
Definition: api_anydb.cc:63
int repetition_number
Definition: perftest.h:35
double last_indexlog_timer
Definition: perftest.h:43
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
void repetition_end()
End a repetition of the tests.
Definition: perftest.cc:436
void search_end(const Xapian::Query &query, const Xapian::MSet &mset)
Log the completion of a search.
Definition: perftest.cc:381
void indexing_log()
Write a log entry for the current indexing run.
Definition: perftest.cc:325
void searching_end()
Log the end of a search run.
Definition: perftest.cc:400
void write(const std::string &text)
Definition: perftest.cc:276
void testcase_end()
End a testcase.
Definition: perftest.cc:419
Class representing a query.
Definition: query.h:46
PerfTestLogger logger
Definition: perftest.cc:52
void indexing_begin(const std::string &dbname, const std::map< std::string, std::string > &params)
Log the start of an indexing run.
Definition: perftest.cc:293