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