diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 4395a9e..039d58d 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -7,7 +7,11 @@ "/home/GHo/Documents/Code/Theron++", "/opt/AMPL/amplapi/include/", "${workspaceFolder}/**", +<<<<<<< PATCH SET (21fe96 First release) + "/home/GHo/Documents/Code/Theron++" +======= "/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13" +>>>>>>> BASE (719fa3 Add Dockerfile) ], "defines": [], "cStandard": "c23", diff --git a/ExecutionControl.cpp b/ExecutionControl.cpp index 7b57811..dd74d63 100644 --- a/ExecutionControl.cpp +++ b/ExecutionControl.cpp @@ -89,6 +89,8 @@ ExecutionControl::ExecutionControl( const std::string & TheActorName ) Send( StatusMessage( StatusMessage::State::Starting ), Address( std::string( StatusTopic ) ) ); +<<<<<<< PATCH SET (21fe96 First release) +======= } // The destructor simply closes the publisher if the network is still active @@ -101,6 +103,7 @@ ExecutionControl::~ExecutionControl( void ) Theron::AMQ::NetworkLayer::TopicSubscription::Action::ClosePublisher, std::string( StatusTopic ) ), GetSessionLayerAddress() ); +>>>>>>> BASE (719fa3 Add Dockerfile) } } // namespace NebulOuS \ No newline at end of file diff --git a/MetricUpdater.cpp b/MetricUpdater.cpp index 39492b9..87a88c2 100644 --- a/MetricUpdater.cpp +++ b/MetricUpdater.cpp @@ -42,19 +42,50 @@ namespace NebulOuS void MetricUpdater::AddMetricSubscription( const MetricTopic & TheMetrics, const Address OptimiserController ) { +<<<<<<< PATCH SET (21fe96 First release) + if( TheMetrics.is_object() && + TheMetrics.at( NebulOuS::MetricList ).is_object() ) + { + JSON MetricList = TheMetrics.at( NebulOuS::MetricList ); + + for( const JSON MetricDefinition : MetricList.items() ) + { + auto [ MetricRecord, NewMetric ] = MetricValues.try_emplace( + MetricDefinition.at( NebulOuS::MetricName ), JSON() ); + + if( NewMetric ) + Send( Theron::AMQ::NetworkLayer::TopicSubscription( + Theron::AMQ::NetworkLayer::TopicSubscription::Action::Subscription, + MetricRecord->first ), + Theron::AMQ::Network::GetAddress( Theron::Network::Layer::Session) ); + } + } + else +======= if( TheMetrics.is_object() && TheMetrics.at( NebulOuS::MetricList ).is_array() ) { for (auto & MetricRecord : TheMetrics.at( NebulOuS::MetricList ) ) +>>>>>>> BASE (719fa3 Add Dockerfile) { auto [ MetricRecordPointer, NewMetric ] = MetricValues.try_emplace( MetricRecord.at( NebulOuS::MetricName ), JSON() ); +<<<<<<< PATCH SET (21fe96 First release) + ErrorMessage << "[" << Location.file_name() << " at line " << Location.line() + << "in function " << Location.function_name() <<"] " + << "The message to define a new metric subscription is given as " + << std::endl << TheMetrics.dump(2) << std::endl + << "this is not as expected!"; + + throw std::invalid_argument( ErrorMessage.str() ); +======= if( NewMetric ) Send( Theron::AMQ::NetworkLayer::TopicSubscription( Theron::AMQ::NetworkLayer::TopicSubscription::Action::Subscription, std::string( MetricValueRootString ) + MetricRecordPointer->first ), Theron::AMQ::Network::GetAddress( Theron::Network::Layer::Session) ); +>>>>>>> BASE (719fa3 Add Dockerfile) } } else @@ -108,9 +139,12 @@ void MetricUpdater::UpdateMetricValue( Theron::AMQ::TopicName TheTopic = TheMetricTopic.AsString().erase( 0, NebulOuS::MetricValueRootString.size() ); +<<<<<<< PATCH SET (21fe96 First release) +======= Output << "The metric: " << TheTopic << " has new value " << TheMetricValue[ NebulOuS::ValueLabel ] << std::endl; +>>>>>>> BASE (719fa3 Add Dockerfile) if( MetricValues.contains( TheTopic ) ) { diff --git a/MetricUpdater.hpp b/MetricUpdater.hpp index 708f123..8de2b69 100644 --- a/MetricUpdater.hpp +++ b/MetricUpdater.hpp @@ -88,7 +88,11 @@ constexpr std::string_view TimePoint = "predictionTime"; // defined next. constexpr std::string_view MetricSubscriptions +<<<<<<< PATCH SET (21fe96 First release) + = "eu.nebulouscloud.monitoring.metric_lists"; +======= = "eu.nebulouscloud.monitoring.metric_list"; +>>>>>>> BASE (719fa3 Add Dockerfile) // The JSON message attribute for the list of metrics is another JSON object // stored under the following key, see the Event type III defined in diff --git a/SolverComponent.cpp b/SolverComponent.cpp index 46f98c9..84e83f6 100644 --- a/SolverComponent.cpp +++ b/SolverComponent.cpp @@ -141,9 +141,13 @@ int main( int NumberOfCLIOptions, char ** CLIOptionStrings ) cxxopts::value()->default_value("5672") ) ("S,Solver", "Solver to use, devault Couenne", cxxopts::value()->default_value("couenne") ) +<<<<<<< PATCH SET (21fe96 First release) + ("U,user", "The user name used for the AMQ Broker connection", +======= ("T,Tenant", "Tenant identifier for messages", cxxopts::value()->default_value("TheTenant")) ("U,User", "The user name used for the AMQ Broker connection", +>>>>>>> BASE (719fa3 Add Dockerfile) cxxopts::value()->default_value("admin") ) ("Pw,Password", "The password for the AMQ Broker connection", cxxopts::value()->default_value("admin") )