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>
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_ |
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.
Aws::CloudWatchMetrics::Utils::CloudWatchMetricsFacade::CloudWatchMetricsFacade | ( | const Aws::Client::ClientConfiguration & | client_config | ) |
Creates a new CloudWatchMetricsFacade.
client_config | The 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.
cw_client | The client for interacting with cloudwatch |
Definition at line 41 of file cloudwatch_metrics_facade.cpp.
|
virtualdefault |
|
protecteddefault |
|
private |
Definition at line 46 of file cloudwatch_metrics_facade.cpp.
|
virtual |
Sends a list of metrics to CloudWatch Used to send a list of metrics to CloudWatch.
metric_namespace | A reference to a string with the namespace for all the metrics being posted |
metrics | A reference to a list of metrics that you want sent to CloudWatch |
Reimplemented in MockCloudWatchFacade.
Definition at line 75 of file cloudwatch_metrics_facade.cpp.
|
private |
Definition at line 84 of file cloudwatch_metrics_facade.hpp.