Skip to content

Commit

Permalink
Update benchmark code and script
Browse files Browse the repository at this point in the history
  • Loading branch information
zieckey committed Mar 14, 2017
1 parent 36d2039 commit 16fc93c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
9 changes: 5 additions & 4 deletions benchmark/throughput/evpp/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ class Client {
totalBytesRead += it->bytes_read();
totalMessagesRead += it->messages_read();
}
LOG_WARN << "name=" << name_ << totalBytesRead << " total bytes read";
LOG_WARN << "name=" << name_ << totalMessagesRead << " total messages read";
LOG_WARN << "name=" << name_ << static_cast<double>(totalBytesRead) / static_cast<double>(totalMessagesRead) << " average message size";
LOG_WARN << "name=" << name_ << static_cast<double>(totalBytesRead) / (timeout_ * 1024 * 1024) << " MiB/s throughput";
LOG_WARN << "name=" << name_ << " " << totalBytesRead << " total bytes read";
LOG_WARN << "name=" << name_ << " " << totalMessagesRead << " total messages read";
LOG_WARN << "name=" << name_ << " " << static_cast<double>(totalBytesRead) / static_cast<double>(totalMessagesRead) << " average message size";
LOG_WARN << "name=" << name_ << " " << static_cast<double>(totalBytesRead) / (timeout_ * 1024 * 1024) << " MiB/s throughput";
loop_->QueueInLoop(std::bind(&Client::Quit, this));
}
}
Expand Down Expand Up @@ -163,6 +163,7 @@ void Session::OnConnection(const evpp::TCPConnPtr& conn) {

int main(int argc, char* argv[]) {
google::InitGoogleLogging(argv[0]);
FLAGS_stderrthreshold = 0;
if (argc != 7) {
fprintf(stderr, "Usage: client <host_ip> <port> <threads> <blocksize> <sessions> <time_seconds>\n");
return -1;
Expand Down
9 changes: 5 additions & 4 deletions benchmark/throughput/evpp/client_fixed_size.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ class Client {
totalBytesRead += it->bytes_read();
totalMessagesRead += it->messages_read();
}
LOG_WARN << "name=" << name_ << totalBytesRead << " total bytes read";
LOG_WARN << "name=" << name_ << totalMessagesRead << " total messages read";
LOG_WARN << "name=" << name_ << static_cast<double>(totalBytesRead) / static_cast<double>(totalMessagesRead) << " average message size";
LOG_WARN << "name=" << name_ << static_cast<double>(totalBytesRead) / (timeout_ * 1024 * 1024) << " MiB/s throughput";
LOG_WARN << "name=" << name_ << " " << totalBytesRead << " total bytes read";
LOG_WARN << "name=" << name_ << " " << totalMessagesRead << " total messages read";
LOG_WARN << "name=" << name_ << " " << static_cast<double>(totalBytesRead) / static_cast<double>(totalMessagesRead) << " average message size";
LOG_WARN << "name=" << name_ << " " << static_cast<double>(totalBytesRead) / (timeout_ * 1024 * 1024) << " MiB/s throughput";
loop_->QueueInLoop(std::bind(&Client::Quit, this));
}
}
Expand Down Expand Up @@ -172,6 +172,7 @@ void Session::OnConnection(const evpp::TCPConnPtr& conn) {

int main(int argc, char* argv[]) {
google::InitGoogleLogging(argv[0]);
FLAGS_stderrthreshold = 0;
if (argc != 7) {
fprintf(stderr, "Usage: client <host_ip> <port> <threads> <blocksize> <sessions> <time_seconds>\n");
return -1;
Expand Down
4 changes: 2 additions & 2 deletions benchmark/throughput/evpp/single_thread.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
set -x

killall benchmark_pingpong_server
timeout=${timeout:-5}
timeout=${timeout:-100}
#bufsize=${bufsize:-16384}
nothreads=1

for bufsize in 1024 2048 4096 8192 16384 81920 409600 819200; do
for bufsize in 1024 2048 4096 8192 16384 81920 409600; do
for nosessions in 1 10 100 1000 10000; do
echo "======================> Bufsize: $bufsize Threads: $nothreads Sessions: $nosessions"
taskset -c 1 ./benchmark_pingpong_server 33333 $nothreads & srvpid=$!
Expand Down

0 comments on commit 16fc93c

Please sign in to comment.