Commit d9ae23e5 authored by JINMEI Tatuya's avatar JINMEI Tatuya Committed by Michal 'vorner' Vaner
Browse files

[1601] Use references in the querybench as well

parent 5e17c750
...@@ -76,8 +76,8 @@ private: ...@@ -76,8 +76,8 @@ private:
typedef boost::shared_ptr<const IOEndpoint> IOEndpointPtr; typedef boost::shared_ptr<const IOEndpoint> IOEndpointPtr;
protected: protected:
QueryBenchMark(const bool enable_cache, QueryBenchMark(const bool enable_cache,
const BenchQueries& queries, MessagePtr query_message, const BenchQueries& queries, Message& query_message,
OutputBufferPtr buffer) : OutputBuffer& buffer) :
server_(new AuthSrv(enable_cache, xfrout_client)), server_(new AuthSrv(enable_cache, xfrout_client)),
queries_(queries), queries_(queries),
query_message_(query_message), query_message_(query_message),
...@@ -95,9 +95,9 @@ public: ...@@ -95,9 +95,9 @@ public:
for (query = queries_.begin(); query != query_end; ++query) { for (query = queries_.begin(); query != query_end; ++query) {
IOMessage io_message(&(*query)[0], (*query).size(), dummy_socket, IOMessage io_message(&(*query)[0], (*query).size(), dummy_socket,
*dummy_endpoint); *dummy_endpoint);
query_message_->clear(Message::PARSE); query_message_.clear(Message::PARSE);
buffer_->clear(); buffer_.clear();
server_->processMessage(io_message, *query_message_, *buffer_, server_->processMessage(io_message, query_message_, buffer_,
&server); &server);
} }
...@@ -107,8 +107,8 @@ protected: ...@@ -107,8 +107,8 @@ protected:
AuthSrvPtr server_; AuthSrvPtr server_;
private: private:
const BenchQueries& queries_; const BenchQueries& queries_;
MessagePtr query_message_; Message& query_message_;
OutputBufferPtr buffer_; OutputBuffer& buffer_;
IOSocket& dummy_socket; IOSocket& dummy_socket;
IOEndpointPtr dummy_endpoint; IOEndpointPtr dummy_endpoint;
}; };
...@@ -118,8 +118,8 @@ public: ...@@ -118,8 +118,8 @@ public:
Sqlite3QueryBenchMark(const int cache_slots, Sqlite3QueryBenchMark(const int cache_slots,
const char* const datasrc_file, const char* const datasrc_file,
const BenchQueries& queries, const BenchQueries& queries,
MessagePtr query_message, Message& query_message,
OutputBufferPtr buffer) : OutputBuffer& buffer) :
QueryBenchMark(cache_slots >= 0 ? true : false, queries, QueryBenchMark(cache_slots >= 0 ? true : false, queries,
query_message, buffer) query_message, buffer)
{ {
...@@ -136,8 +136,8 @@ public: ...@@ -136,8 +136,8 @@ public:
MemoryQueryBenchMark(const char* const zone_file, MemoryQueryBenchMark(const char* const zone_file,
const char* const zone_origin, const char* const zone_origin,
const BenchQueries& queries, const BenchQueries& queries,
MessagePtr query_message, Message& query_message,
OutputBufferPtr buffer) : OutputBuffer& buffer) :
QueryBenchMark(false, queries, query_message, buffer) QueryBenchMark(false, queries, query_message, buffer)
{ {
configureAuthServer(*server_, configureAuthServer(*server_,
...@@ -255,8 +255,8 @@ main(int argc, char* argv[]) { ...@@ -255,8 +255,8 @@ main(int argc, char* argv[]) {
BenchQueries queries; BenchQueries queries;
loadQueryData(query_data_file, queries, RRClass::IN()); loadQueryData(query_data_file, queries, RRClass::IN());
OutputBufferPtr buffer(new OutputBuffer(4096)); OutputBuffer buffer(4096);
MessagePtr message(new Message(Message::PARSE)); Message message(Message::PARSE);
cout << "Parameters:" << endl; cout << "Parameters:" << endl;
cout << " Iterations: " << iteration << endl; cout << " Iterations: " << iteration << endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment