bench small change

This commit is contained in:
gabime 2014-11-24 01:54:49 +02:00
parent 7f0434528b
commit c56fae39e8
2 changed files with 5 additions and 10 deletions

View File

@ -12,6 +12,5 @@ int main(int, char* [])
logger->set_pattern("[%Y-%b-%d %T.%e]: %v");
for(int i = 0 ; i < howmany; ++i)
logger->info() << "spdlog message #" << i << ": This is some text for your pleasure";
return 0;
}

View File

@ -63,7 +63,7 @@ int main(int argc, char* argv[])
howmany = atoi(argv[1]);
if (argc > 2)
threads = atoi(argv[2]);
cout << "*******************************************************************************\n";
cout << "Single thread, " << format(howmany) << " iterations, flush every " << flush_interval << " lines"<< endl;
cout << "*******************************************************************************\n";
@ -85,23 +85,19 @@ int main(int argc, char* argv[])
auto daily_mt = spdlog::daily_logger_mt("daily_mt", "logs/daily_mt", flush_interval);
bench_mt(howmany, daily_mt, threads);
bench(howmany, spdlog::create<null_sink_st>("null_mt"));
cout << "\n*******************************************************************************\n";
cout << "async logging.. " << threads << " threads sharing same logger, " << format(howmany) << " iterations, flush every " << flush_interval << " lines" << endl;
cout << "*******************************************************************************\n";
spdlog::set_async_mode(howmany);
auto rotating_st_async = spdlog::rotating_logger_st("rotating_st_Async", "logs/rotating_st_async", file_size, rotating_files, flush_interval);
auto rotating_st_async = spdlog::rotating_logger_st("rotating_async", "logs/rotating_async", file_size, rotating_files, flush_interval);
bench(howmany, rotating_st_async);
auto daily_st_async = spdlog::daily_logger_st("daily_st_async", "logs/daily_st_async", flush_interval);
auto daily_st_async = spdlog::daily_logger_st("daily_async", "logs/daily_async", flush_interval);
bench(howmany, daily_st_async);
bench(howmany, spdlog::create<null_sink_st>("null_st_async"));
bench(howmany, spdlog::create<null_sink_st>("null_async"));
spdlog::stop();
cin.ignore();
}
catch (std::exception &ex)