From 313cf335dd433dc74e087847d599fa02615f6027 Mon Sep 17 00:00:00 2001 From: Geir Horn Date: Thu, 25 Jan 2024 14:21:23 +0100 Subject: [PATCH] Fix last changeset Change-Id: Ie541e8f6fdbc2b5881df1b3e25afc48d97efaa1b --- .vscode/c_cpp_properties.json | 4 ---- ExecutionControl.cpp | 3 --- MetricUpdater.cpp | 34 ---------------------------------- MetricUpdater.hpp | 4 ---- SolverComponent.cpp | 4 ---- 5 files changed, 49 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 039d58d..4395a9e 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -7,11 +7,7 @@ "/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 dd74d63..7b57811 100644 --- a/ExecutionControl.cpp +++ b/ExecutionControl.cpp @@ -89,8 +89,6 @@ 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 @@ -103,7 +101,6 @@ 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 87a88c2..39492b9 100644 --- a/MetricUpdater.cpp +++ b/MetricUpdater.cpp @@ -42,50 +42,19 @@ 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 @@ -139,12 +108,9 @@ 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 8de2b69..708f123 100644 --- a/MetricUpdater.hpp +++ b/MetricUpdater.hpp @@ -88,11 +88,7 @@ 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 84e83f6..46f98c9 100644 --- a/SolverComponent.cpp +++ b/SolverComponent.cpp @@ -141,13 +141,9 @@ 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") )