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

This class is a simple Facade over the CloudWatch client. This class is a very small abstraction over the CloudWatch client. It allows us to change the details of how we're communicating with CloudWatch without the need to expose this in the rest of our code. It also provides a shim for us to be able to Mock to unit test the rest of the code. More...

#include <cloudwatch_metrics_facade.hpp>

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

Public Member Functions

 CloudWatchMetricsFacade (const Aws::Client::ClientConfiguration &client_config)
 Creates a new CloudWatchMetricsFacade. More...
 
 CloudWatchMetricsFacade (const std::shared_ptr< Aws::CloudWatch::CloudWatchClient > &cw_client)
 Creates a new CloudWatchMetricsFacade with an existing client. More...
 
virtual CloudWatchMetricsStatus SendMetricsToCloudWatch (const std::string &metric_namespace, MetricDatumCollection &metrics)
 Sends a list of metrics to CloudWatch Used to send a list of metrics to CloudWatch. More...
 
virtual ~CloudWatchMetricsFacade ()=default
 

Protected Member Functions

 CloudWatchMetricsFacade ()=default
 

Private Member Functions

CloudWatchMetricsStatus SendMetricsRequest (const Aws::CloudWatch::Model::PutMetricDataRequest &request)
 

Private Attributes

std::shared_ptr< Aws::CloudWatch::CloudWatchClient > cw_client_
 

Detailed Description

This class is a simple Facade over the CloudWatch client. This class is a very small abstraction over the CloudWatch client. It allows us to change the details of how we're communicating with CloudWatch without the need to expose this in the rest of our code. It also provides a shim for us to be able to Mock to unit test the rest of the code.

This class expects Aws::InitAPI() to have already been called before an instance is constructed

Definition at line 48 of file cloudwatch_metrics_facade.hpp.

Constructor & Destructor Documentation

Aws::CloudWatchMetrics::Utils::CloudWatchMetricsFacade::CloudWatchMetricsFacade ( const Aws::Client::ClientConfiguration &  client_config)

Creates a new CloudWatchMetricsFacade.

Parameters
client_configThe configuration for the cloudwatch client

Definition at line 36 of file cloudwatch_metrics_facade.cpp.

Aws::CloudWatchMetrics::Utils::CloudWatchMetricsFacade::CloudWatchMetricsFacade ( const std::shared_ptr< Aws::CloudWatch::CloudWatchClient > &  cw_client)

Creates a new CloudWatchMetricsFacade with an existing client.

Parameters
cw_clientThe client for interacting with cloudwatch

Definition at line 41 of file cloudwatch_metrics_facade.cpp.

virtual Aws::CloudWatchMetrics::Utils::CloudWatchMetricsFacade::~CloudWatchMetricsFacade ( )
virtualdefault
Aws::CloudWatchMetrics::Utils::CloudWatchMetricsFacade::CloudWatchMetricsFacade ( )
protecteddefault

Member Function Documentation

CloudWatchMetricsStatus Aws::CloudWatchMetrics::Utils::CloudWatchMetricsFacade::SendMetricsRequest ( const Aws::CloudWatch::Model::PutMetricDataRequest &  request)
private

Definition at line 46 of file cloudwatch_metrics_facade.cpp.

CloudWatchMetricsStatus Aws::CloudWatchMetrics::Utils::CloudWatchMetricsFacade::SendMetricsToCloudWatch ( const std::string &  metric_namespace,
MetricDatumCollection metrics 
)
virtual

Sends a list of metrics to CloudWatch Used to send a list of metrics to CloudWatch.

Parameters
metric_namespaceA reference to a string with the namespace for all the metrics being posted
metricsA reference to a list of metrics that you want sent to CloudWatch
Returns
An error code that will be Aws::AwsError::AWS_ERR_OK if all metrics were sent successfully.

Reimplemented in MockCloudWatchFacade.

Definition at line 75 of file cloudwatch_metrics_facade.cpp.

Member Data Documentation

std::shared_ptr<Aws::CloudWatch::CloudWatchClient> Aws::CloudWatchMetrics::Utils::CloudWatchMetricsFacade::cw_client_
private

Definition at line 84 of file cloudwatch_metrics_facade.hpp.


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


cloudwatch_metrics_common
Author(s): AWS RoboMaker
autogenerated on Fri May 7 2021 02:18:26