This commit is contained in:
gabime
2014-11-29 20:02:14 +02:00
parent 8d25324444
commit 73b31e4d10
8 changed files with 564 additions and 291 deletions

View File

@@ -52,7 +52,7 @@ int main(int argc, char* argv[])
int howmany = 1000000;
int threads = 10;
bool auto_flush = false;
bool auto_flush = false;
int file_size = 30 * 1024 * 1024;
int rotating_files = 5;
@@ -79,22 +79,22 @@ int main(int argc, char* argv[])
cout << "*******************************************************************************\n";
auto rotating_mt = spdlog::rotating_logger_mt("rotating_mt", "logs/rotating_mt", file_size, rotating_files, auto_flush);
bench_mt(howmany, rotating_mt, threads);
bench_mt(howmany, rotating_mt, threads);
auto daily_mt = spdlog::daily_logger_mt("daily_mt", "logs/daily_mt", auto_flush);
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, auto_flush=" << auto_flush << endl;
cout << "*******************************************************************************\n";
cout << "*******************************************************************************\n";
spdlog::set_async_mode(2500);
auto daily_st_async = spdlog::daily_logger_st("daily_async", "logs/daily_async", auto_flush);
bench_mt(howmany, daily_st_async, threads);
bench_mt(howmany, daily_st_async, threads);
spdlog::stop();
}