20 #include <ros_monitoring_msgs/MetricList.h> 21 #include <ros_monitoring_msgs/MetricData.h> 22 #include <std_srvs/Trigger.h> 23 #include <std_srvs/Empty.h> 32 namespace CloudWatchMetrics {
48 int RecordMetrics(
const ros_monitoring_msgs::MetricList::ConstPtr & metric_list_msg);
66 std::map<std::string, std::string> & default_dimensions,
67 int storage_resolution,
69 const Aws::Client::ClientConfiguration & config,
70 const Aws::SDKOptions & sdk_options,
72 const std::shared_ptr<MetricServiceFactory>& metric_service_factory = std::make_shared<MetricServiceFactory>());
76 bool start()
override;
86 bool checkIfOnline(std_srvs::Trigger::Request& request, std_srvs::Trigger::Response& response);
std::string metric_namespace_
int RecordMetrics(const ros_monitoring_msgs::MetricList::ConstPtr &metric_list_msg)
std::vector< ros::Subscriber > subscriptions_
void Initialize(std::string metric_namespace, std::map< std::string, std::string > &default_dimensions, int storage_resolution, const ros::NodeHandle &node_handle, const Aws::Client::ClientConfiguration &config, const Aws::SDKOptions &sdk_options, const Aws::CloudWatchMetrics::CloudWatchOptions &cloudwatch_options, const std::shared_ptr< MetricServiceFactory > &metric_service_factory=std::make_shared< MetricServiceFactory >())
std::map< std::string, std::string > default_dimensions_
std::atomic< int > storage_resolution_
MetricsCollector()=default
ros::NodeHandle node_handle_
~MetricsCollector() override=default
void SubscribeAllTopics()
static int64_t GetMetricDataEpochMillis(const ros_monitoring_msgs::MetricData &metric_msg)
void TriggerPublish(const ros::TimerEvent &)
bool checkIfOnline(std_srvs::Trigger::Request &request, std_srvs::Trigger::Response &response)
std::vector< std::string > topics_
std::shared_ptr< MetricService > metric_service_