diff --git a/producer/event_monitor_producer/src/eventmon_config.cpp b/producer/event_monitor_producer/src/eventmon_config.cpp index 24882a220eab1a2e8b60b25b42e37d7e2b29912c..759e36232ad0f1ae2be15417f1493c0a4ecbd8b4 100644 --- a/producer/event_monitor_producer/src/eventmon_config.cpp +++ b/producer/event_monitor_producer/src/eventmon_config.cpp @@ -39,6 +39,7 @@ Error EventMonConfigFactory::ParseConfigFile(std::string file_name) { (err = parser.GetString("AsapoEndpoint", &config.asapo_endpoint)) || (err = parser.GetString("Tag", &config.tag)) || (err = parser.GetString("BeamtimeID", &config.beamtime_id)) || + (err = parser.GetString("Stream", &config.stream)) || (err = parser.GetString("Mode", &config.mode_str)) || (err = parser.GetUInt64("NThreads", &config.nthreads)) || (err = parser.GetString("RootMonitoredFolder", &config.root_monitored_folder)) || diff --git a/producer/event_monitor_producer/src/eventmon_config.h b/producer/event_monitor_producer/src/eventmon_config.h index bbdd82bc2d319fc9f468ec5a74d99bf97548db6d..12ce592a36c432aea33b2f02608a9fd4f276173e 100644 --- a/producer/event_monitor_producer/src/eventmon_config.h +++ b/producer/event_monitor_producer/src/eventmon_config.h @@ -30,6 +30,7 @@ struct EventMonConfig { uint64_t subset_batch_size = 1; uint64_t subset_multisource_nsources = 1; uint64_t subset_multisource_sourceid = 1; + std::string stream; private: std::string log_level_str; std::string mode_str; diff --git a/producer/event_monitor_producer/src/main_eventmon.cpp b/producer/event_monitor_producer/src/main_eventmon.cpp index 884ab29770a5335d9d87b8c357aca2224279b0bd..e277e7b111866f18a2fa0c614987bd2b189c577c 100644 --- a/producer/event_monitor_producer/src/main_eventmon.cpp +++ b/producer/event_monitor_producer/src/main_eventmon.cpp @@ -39,7 +39,7 @@ std::unique_ptr<Producer> CreateProducer() { Error err; auto producer = Producer::Create(config->asapo_endpoint, (uint8_t) config->nthreads, - config->mode, asapo::SourceCredentials{config->beamtime_id, "", ""}, &err); + config->mode, asapo::SourceCredentials{config->beamtime_id, config->stream, ""}, &err); if(err) { std::cerr << "cannot create producer: " << err << std::endl; exit(EXIT_FAILURE); diff --git a/producer/event_monitor_producer/unittests/mock_eventmon_config.cpp b/producer/event_monitor_producer/unittests/mock_eventmon_config.cpp index bf3be313969dac4ad8a52d46e7a31c7a72b98c4e..3a5112aaae98529a42e33293efbbed74d6bd97b7 100644 --- a/producer/event_monitor_producer/unittests/mock_eventmon_config.cpp +++ b/producer/event_monitor_producer/unittests/mock_eventmon_config.cpp @@ -49,6 +49,7 @@ Error SetFolderMonConfig (const EventMonConfig& config) { config_string += "," + std::string("\"NThreads\":") + std::to_string(config.nthreads); config_string += "," + std::string("\"LogLevel\":") + "\"" + log_level + "\""; config_string += "," + std::string("\"RemoveAfterSend\":") + (config.remove_after_send ? "true" : "false"); + config_string += "," + std::string("\"Stream\":") + "\"" + config.stream + "\""; std::string subset_mode; switch (config.subset_mode) { diff --git a/producer/event_monitor_producer/unittests/test_eventmon_config.cpp b/producer/event_monitor_producer/unittests/test_eventmon_config.cpp index 544f12cbb42cabe7ede883d535b7ed17875e9a31..630ef13e8513c786050ba03ee0d698c3db5201ff 100644 --- a/producer/event_monitor_producer/unittests/test_eventmon_config.cpp +++ b/producer/event_monitor_producer/unittests/test_eventmon_config.cpp @@ -64,6 +64,8 @@ TEST_F(ConfigTests, ReadSettingsOK) { test_config.remove_after_send = true; test_config.subset_mode = SubSetMode::kBatch; test_config.subset_batch_size = 9; + test_config.stream = "stream"; + auto err = asapo::SetFolderMonConfig(test_config); auto config = asapo::GetEventMonConfig(); @@ -81,6 +83,7 @@ TEST_F(ConfigTests, ReadSettingsOK) { ASSERT_THAT(config->remove_after_send, Eq(true)); ASSERT_THAT(config->subset_mode, Eq(SubSetMode::kBatch)); ASSERT_THAT(config->subset_batch_size, Eq(9)); + ASSERT_THAT(config->stream, Eq("stream")); } diff --git a/tests/automatic/bug_fixes/producer_send_after_restart/test.json.in b/tests/automatic/bug_fixes/producer_send_after_restart/test.json.in index 995984533959e3caedd3d29d64be1cfb83a10c44..5e120714393ce7008d62dcea60798b71e6762b91 100644 --- a/tests/automatic/bug_fixes/producer_send_after_restart/test.json.in +++ b/tests/automatic/bug_fixes/producer_send_after_restart/test.json.in @@ -9,6 +9,7 @@ "MonitoredSubFolders":["test1"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"none" } diff --git a/tests/automatic/bug_fixes/receiver_cpu_usage/test.json.in b/tests/automatic/bug_fixes/receiver_cpu_usage/test.json.in index 4b7d3fc60d8c8d77e669bba405b93e955a55f03f..4f4cfcc124f24e24042daa00aa502d4389f46bd4 100644 --- a/tests/automatic/bug_fixes/receiver_cpu_usage/test.json.in +++ b/tests/automatic/bug_fixes/receiver_cpu_usage/test.json.in @@ -9,6 +9,7 @@ "MonitoredSubFolders":["test1"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"none" } diff --git a/tests/automatic/full_chain/simple_chain_filegen/test.json.in b/tests/automatic/full_chain/simple_chain_filegen/test.json.in index 758d184a81e40e342b9ca3c75118b6447393e10d..d08b0242ebce2b0ee56615bd24825e760c1e6dcb 100644 --- a/tests/automatic/full_chain/simple_chain_filegen/test.json.in +++ b/tests/automatic/full_chain/simple_chain_filegen/test.json.in @@ -9,6 +9,7 @@ "MonitoredSubFolders":["test1","test2"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"none" } diff --git a/tests/automatic/full_chain/simple_chain_filegen_batches/test.json.in b/tests/automatic/full_chain/simple_chain_filegen_batches/test.json.in index b2aaa867354e89d7b0989fd54361915130172003..c53eecd99f80ba97264a4a9edf102ff6a7fcd2a4 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_batches/test.json.in +++ b/tests/automatic/full_chain/simple_chain_filegen_batches/test.json.in @@ -9,6 +9,7 @@ "MonitoredSubFolders":["test1","test2"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":false, + "Stream": "", "Subset": { "Mode":"batch", "BatchSize":3 diff --git a/tests/automatic/full_chain/simple_chain_filegen_multisource/test.json.in b/tests/automatic/full_chain/simple_chain_filegen_multisource/test.json.in index 6318341dd71cc62b6ae0d808993f1c2721611027..be12d54a998566051a7e30ae2284a0fab99ecc69 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_multisource/test.json.in +++ b/tests/automatic/full_chain/simple_chain_filegen_multisource/test.json.in @@ -9,6 +9,7 @@ "MonitoredSubFolders":["test@ID@"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"multisource", "SourceId":@ID@, diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/test.json.in b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/test.json.in index b7b1f67605fd45d7047f0706cc73bd964ae9869a..501bcff83fe36e74b5224563e5d78313f85863da 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/test.json.in +++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/test.json.in @@ -9,6 +9,7 @@ "MonitoredSubFolders":["test1","test2"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"none" } diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/test.json.in b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/test.json.in index b7b1f67605fd45d7047f0706cc73bd964ae9869a..501bcff83fe36e74b5224563e5d78313f85863da 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/test.json.in +++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/test.json.in @@ -9,6 +9,7 @@ "MonitoredSubFolders":["test1","test2"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"none" } diff --git a/tests/automatic/producer/file_monitor_producer/test.json.in b/tests/automatic/producer/file_monitor_producer/test.json.in index 088681a0ddc231f34ebd9c66b3a5809150f0bbc8..60405050db7de85880a45a7388fa2d9796764c96 100644 --- a/tests/automatic/producer/file_monitor_producer/test.json.in +++ b/tests/automatic/producer/file_monitor_producer/test.json.in @@ -9,6 +9,7 @@ "MonitoredSubFolders":["test1","test2"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"none" } diff --git a/tests/manual/tests_via_nomad/asapo-test_filemon.nomad.in b/tests/manual/tests_via_nomad/asapo-test_filemon.nomad.in index 250a268036d383197c72106e42ca991914c4b781..480df303f522f2448e2c6c4384fb197538371de5 100644 --- a/tests/manual/tests_via_nomad/asapo-test_filemon.nomad.in +++ b/tests/manual/tests_via_nomad/asapo-test_filemon.nomad.in @@ -40,6 +40,7 @@ job "asapo-filemon" { "MonitoredSubFolders":["test_folder"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"none" } @@ -99,6 +100,7 @@ job "asapo-filemon" { "MonitoredSubFolders":["data"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"none" } diff --git a/tests/manual/tests_via_nomad/asapo-test_filemon_batch.nomad.in b/tests/manual/tests_via_nomad/asapo-test_filemon_batch.nomad.in index 85e5872e9029e5ff696225e11f520b9781ebc6af..a750fff7410e1e51b6e765045052f793acf11d81 100644 --- a/tests/manual/tests_via_nomad/asapo-test_filemon_batch.nomad.in +++ b/tests/manual/tests_via_nomad/asapo-test_filemon_batch.nomad.in @@ -40,6 +40,7 @@ job "asapo-filemon_batch" { "MonitoredSubFolders":["test_folder"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"batch", "BatchSize": {{ keyOrDefault "monitor_batch_size" "3" }} @@ -100,6 +101,7 @@ job "asapo-filemon_batch" { "MonitoredSubFolders":["data"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"batch", "BatchSize": {{ keyOrDefault "monitor_batch_size" "3" }} diff --git a/tests/manual/tests_via_nomad/asapo-test_filemon_multisource.nomad.in b/tests/manual/tests_via_nomad/asapo-test_filemon_multisource.nomad.in index 2a6159367306c3d349492fd3d740dbdadc7d89b0..12d7ea1951796a61e4692c64aca60beb1a333950 100644 --- a/tests/manual/tests_via_nomad/asapo-test_filemon_multisource.nomad.in +++ b/tests/manual/tests_via_nomad/asapo-test_filemon_multisource.nomad.in @@ -40,6 +40,7 @@ job "asapo-filemon_multisource" { "MonitoredSubFolders":["test_folder"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"multisource", "SourceId": 1, @@ -101,6 +102,7 @@ job "asapo-filemon_multisource" { "MonitoredSubFolders":["data"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"multisource", "SourceId": 2, diff --git a/tests/manual/tests_via_nomad/asapo-test_filemon_producer_tolocal.nomad.in b/tests/manual/tests_via_nomad/asapo-test_filemon_producer_tolocal.nomad.in index e40fe1738f8fd6bd9f627200769a1cc60afab290..0c5c80af7ff95a297f526dcbda867dbcd8390773 100644 --- a/tests/manual/tests_via_nomad/asapo-test_filemon_producer_tolocal.nomad.in +++ b/tests/manual/tests_via_nomad/asapo-test_filemon_producer_tolocal.nomad.in @@ -40,6 +40,7 @@ job "asapo-produceronly" { "MonitoredSubFolders":["test_folder"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"none" } @@ -99,6 +100,7 @@ job "asapo-produceronly" { "MonitoredSubFolders":["test_folder"], "IgnoreExtentions":["tmp"], "RemoveAfterSend":true, + "Stream": "", "Subset": { "Mode":"none" }