Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Aws::CloudWatchMetrics::Utils::MetricsCollector Class Reference

#include <metrics_collector.hpp>

Inheritance diagram for Aws::CloudWatchMetrics::Utils::MetricsCollector:
Inheritance graph
[legend]

Public Member Functions

bool checkIfOnline (std_srvs::Trigger::Request &request, std_srvs::Trigger::Response &response)
 
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 >())
 
 MetricsCollector ()=default
 
int RecordMetrics (const ros_monitoring_msgs::MetricList::ConstPtr &metric_list_msg)
 
bool shutdown () override
 
bool start () override
 
void SubscribeAllTopics ()
 
void TriggerPublish (const ros::TimerEvent &)
 
 ~MetricsCollector () override=default
 
- Public Member Functions inherited from Service
ServiceState getState ()
 
virtual std::string getStatusString ()
 
 Service ()
 
virtual ~Service ()=default
 

Static Public Member Functions

static int64_t GetMetricDataEpochMillis (const ros_monitoring_msgs::MetricData &metric_msg)
 

Private Attributes

std::map< std::string, std::string > default_dimensions_
 
std::string metric_namespace_
 
std::shared_ptr< MetricServicemetric_service_
 
ros::NodeHandle node_handle_
 
std::atomic< int > storage_resolution_ {}
 
std::vector< ros::Subscribersubscriptions_
 
std::vector< std::string > topics_
 

Additional Inherited Members

- Protected Member Functions inherited from Service
void setState (ServiceState new_state)
 

Detailed Description

Definition at line 35 of file metrics_collector.hpp.

Constructor & Destructor Documentation

Aws::CloudWatchMetrics::Utils::MetricsCollector::MetricsCollector ( )
default
Aws::CloudWatchMetrics::Utils::MetricsCollector::~MetricsCollector ( )
overridedefault

Member Function Documentation

bool Aws::CloudWatchMetrics::Utils::MetricsCollector::checkIfOnline ( std_srvs::Trigger::Request &  request,
std_srvs::Trigger::Response &  response 
)

Return a Trigger response detailing the MetricService online status.

Parameters
requestinput request
responseoutput response
Returns
true if the request was handled successfully, false otherwise

Definition at line 149 of file metrics_collector.cpp.

int64_t Aws::CloudWatchMetrics::Utils::MetricsCollector::GetMetricDataEpochMillis ( const ros_monitoring_msgs::MetricData &  metric_msg)
static

Gets the timestamp for the input metric message as milliseconds since epoch

Definition at line 119 of file metrics_collector.cpp.

void Aws::CloudWatchMetrics::Utils::MetricsCollector::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>() 
)

Initialize the MetricsCollector with parameters read from the config file.

Parameters
metric_namespace
default_dimensions
storage_resolution
config
sdk_options
metric_service_factory

Definition at line 48 of file metrics_collector.cpp.

int Aws::CloudWatchMetrics::Utils::MetricsCollector::RecordMetrics ( const ros_monitoring_msgs::MetricList::ConstPtr &  metric_list_msg)

Accept input metric message to be batched for publishing.

Parameters
metric_list_msg
Returns
the number of metrics successfully batched

Definition at line 80 of file metrics_collector.cpp.

bool Aws::CloudWatchMetrics::Utils::MetricsCollector::shutdown ( )
overridevirtual

Reimplemented from Service.

Definition at line 141 of file metrics_collector.cpp.

bool Aws::CloudWatchMetrics::Utils::MetricsCollector::start ( )
overridevirtual

Reimplemented from Service.

Definition at line 130 of file metrics_collector.cpp.

void Aws::CloudWatchMetrics::Utils::MetricsCollector::SubscribeAllTopics ( )

Definition at line 67 of file metrics_collector.cpp.

void Aws::CloudWatchMetrics::Utils::MetricsCollector::TriggerPublish ( const ros::TimerEvent )

Force all batched data to be published to CloudWatch.

Definition at line 124 of file metrics_collector.cpp.

Member Data Documentation

std::map<std::string, std::string> Aws::CloudWatchMetrics::Utils::MetricsCollector::default_dimensions_
private

Definition at line 96 of file metrics_collector.hpp.

std::string Aws::CloudWatchMetrics::Utils::MetricsCollector::metric_namespace_
private

Definition at line 95 of file metrics_collector.hpp.

std::shared_ptr<MetricService> Aws::CloudWatchMetrics::Utils::MetricsCollector::metric_service_
private

Definition at line 98 of file metrics_collector.hpp.

ros::NodeHandle Aws::CloudWatchMetrics::Utils::MetricsCollector::node_handle_
private

Definition at line 100 of file metrics_collector.hpp.

std::atomic<int> Aws::CloudWatchMetrics::Utils::MetricsCollector::storage_resolution_ {}
private

Definition at line 97 of file metrics_collector.hpp.

std::vector<ros::Subscriber> Aws::CloudWatchMetrics::Utils::MetricsCollector::subscriptions_
private

Definition at line 99 of file metrics_collector.hpp.

std::vector<std::string> Aws::CloudWatchMetrics::Utils::MetricsCollector::topics_
private

Definition at line 101 of file metrics_collector.hpp.


The documentation for this class was generated from the following files:


cloudwatch_metrics_collector
Author(s): AWS RoboMaker
autogenerated on Fri Mar 5 2021 03:38:40