This commit is contained in:
gabime 2018-06-01 17:52:05 +03:00
parent 5997e5aae7
commit 4b9949de7b
6 changed files with 4 additions and 11 deletions

View File

@ -72,18 +72,14 @@ int main(int argc, char *argv[])
cout << "\n*******************************************************************************\n";
cout << "async logging.. " << threads << " threads sharing same logger, " << format(howmany) << " iterations " << endl;
cout << "*******************************************************************************\n";
for (int i = 0; i < 3; ++i)
{
spdlog::init_thread_pool(queue_size, 1);
spdlog::init_thread_pool(queue_size, 1);
auto as = spdlog::basic_logger_mt<spdlog::create_async>("as", "logs/basic_async.log", true);
bench_mt(howmany, as, threads);
spdlog::drop("as");
}
}
catch (std::exception &ex)
{

View File

@ -69,7 +69,7 @@ int main(int argc, char *argv[])
spdlog::init_thread_pool(tp_queue_size, tp_threads);
auto as = spdlog::create_async_logger<null_sink_mt>("async(null-sink)");
total_rate += bench_as(howmany, as, client_threads);
spdlog::drop("async(null-sink)");
spdlog::drop("async(null-sink)");
}
std::cout << endl;
std::cout << "Avg rate: " << format(total_rate / iters) << "/sec" << std::endl;

View File

@ -113,7 +113,7 @@ void async_example()
for (int i = 0; i < 100; ++i)
{
async_file->info("Async message #{}", i + 1);
}
}
}
// syslog example (linux/osx/freebsd)

View File

@ -71,7 +71,6 @@ public:
pop_cv_.notify_one();
return true;
}
private:
size_t max_items_;

View File

@ -138,7 +138,6 @@ public:
{
return msg_counter_.load(std::memory_order_relaxed);
}
private:
std::atomic<size_t> msg_counter_; // total # of messages processed in this pool

View File

@ -77,7 +77,6 @@ TEST_CASE("tp->wait_empty() ", "[async]")
logger->flush();
tp.reset();
REQUIRE(test_sink->msg_counter() == messages);
REQUIRE(test_sink->flush_counter() == 1);
}