This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
The following commit(s) were added to refs/heads/master by this push:
new 379a6e9f Benchmark async checks should use AsyncAppender (#359)
379a6e9f is described below
commit 379a6e9f9210790cf320104f2c19fc65f2409a34
Author: Stephen Webb <[email protected]>
AuthorDate: Fri Mar 8 12:48:04 2024 +1100
Benchmark async checks should use AsyncAppender (#359)
---
src/test/cpp/benchmark/benchmark.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/cpp/benchmark/benchmark.cpp
b/src/test/cpp/benchmark/benchmark.cpp
index 49df7fe1..2bc04b7a 100644
--- a/src/test/cpp/benchmark/benchmark.cpp
+++ b/src/test/cpp/benchmark/benchmark.cpp
@@ -143,7 +143,7 @@ public: // Class methods
writer->setLayout(std::make_shared<PatternLayout>(LOG4CXX_STR("%m%n")));
auto asyncAppender = std::make_shared<AsyncAppender>();
asyncAppender->addAppender(writer);
- asyncAppender->setBlocking(true);
+ asyncAppender->setBlocking(false);
result = r->getLogger(name);
result->setAdditivity(false);
result->setLevel(Level::getInfo());
@@ -286,7 +286,7 @@ BENCHMARK_DEFINE_F(benchmarker,
asyncIntPlusFloatValueMessageBuffer)(benchmark::
for (auto _ : state)
{
auto f = static_cast<float>(rand()) /
static_cast<float>(RAND_MAX);
- LOG4CXX_INFO( m_logger, "Hello: message number " << ++x
+ LOG4CXX_INFO( m_asyncLogger, "Hello: message number " << ++x
<< " pseudo-random float " << std::setprecision(3) <<
std::fixed << f);
}
}