From 4080aa50d131fb28be0ea46329ba36edbac88187 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Thu, 9 Nov 2023 15:50:37 -0500 Subject: [PATCH] JTest: Optionally disable CSV output --- src/plugins/JTest/JTestMain.cc | 9 ++++++--- src/programs/perf_tests/PerfTests.cc | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/JTest/JTestMain.cc b/src/plugins/JTest/JTestMain.cc index 53c3ba713..c9338e950 100644 --- a/src/plugins/JTest/JTestMain.cc +++ b/src/plugins/JTest/JTestMain.cc @@ -23,9 +23,12 @@ void InitPlugin(JApplication *app){ app->Add(new JFactoryGeneratorT()); app->Add(new JFactoryGeneratorT()); - // Demonstrates attaching a CSV writer so we can view the results from any JFactory - app->SetParameterValue("csv:dest_dir", "."); - app->Add(new JCsvWriter()); + bool write_csv = false; + app->SetDefaultParameter("jtest:write_csv", write_csv); + if (write_csv) { + // Demonstrates attaching a CSV writer so we can view the results from any JFactory + app->Add(new JCsvWriter()); + } // Demonstrates sharing user-defined services with our components app->ProvideService(std::make_shared()); diff --git a/src/programs/perf_tests/PerfTests.cc b/src/programs/perf_tests/PerfTests.cc index e7f6fcf0a..bdb8cfa22 100644 --- a/src/programs/perf_tests/PerfTests.cc +++ b/src/programs/perf_tests/PerfTests.cc @@ -50,6 +50,7 @@ int main() { auto params = new JParameterManager; params->SetParameter("log:off", "JApplication,JPluginLoader,JArrowProcessingController,JArrow"); // Log levels get set as soon as JApp gets constructed XD + params->SetParameter("jtest:write_csv", false); params->SetParameter("jtest:parser_ms", 2); params->SetParameter("benchmark:resultsdir", "perftest_fake_halldrecon"); @@ -58,7 +59,7 @@ int main() { auto logger = app.GetService()->get_logger("PerfTests"); app.AddPlugin("JTest"); - LOG_INFO(logger) << "Running JTest tuned to imitate halld_recon:" << LOG_END; + LOG_INFO(logger) << "Running JTest tuned to imitate halld_recon" << LOG_END; JBenchmarker benchmarker(&app); benchmarker.RunUntilFinished(); } @@ -68,7 +69,8 @@ int main() { auto params = new JParameterManager; params->SetParameter("log:off", "JApplication,JPluginLoader,JArrowProcessingController,JArrow"); // Log levels get set as soon as JApp gets constructed XD - // + params->SetParameter("jtest:write_csv", false); + params->SetParameter("jtest:parser_ms", 0); params->SetParameter("jtest:parser_spread", 0); params->SetParameter("jtest:parser_bytes", 0);