Public Member Functions | Private Attributes | List of all members
Aws::CloudWatchMetrics::MetricPublisher Class Reference

Class that handles sending metrics data to CloudWatch This class is responsible for emitting all the stored metrics to AWS CloudWatch. Metrics are published asynchronously using a thread. The thread waits on a condition variable and is signaled (by AWSCloudWatchMetricManager) whenever new metrics are available. More...

#include <metric_publisher.hpp>

Inheritance diagram for Aws::CloudWatchMetrics::MetricPublisher:
Inheritance graph
[legend]

Public Member Functions

 MetricPublisher (const std::string &metrics_namespace, const Aws::Client::ClientConfiguration &client_config)
 
 MetricPublisher (const std::string &metrics_namespace, std::shared_ptr< Utils::CloudWatchMetricsFacade > cloudwatch_metrics_facade)
 
Aws::DataFlow::UploadStatus publishData (MetricDatumCollection &data) override
 
bool shutdown () override
 
bool start () override
 
 ~MetricPublisher () override=default
 Tears down the MetricPublisher object. More...
 
- Public Member Functions inherited from Publisher< MetricDatumCollection >
virtual void addPublisherStateListener (const std::function< void(const PublisherState &)> &listener)
 
Aws::DataFlow::UploadStatus attemptPublish (MetricDatumCollection &data) override
 
bool canPublish ()
 
std::chrono::milliseconds getLastPublishDuration ()
 
int getPublishAttempts ()
 
PublisherState getPublisherState ()
 
int getPublishSuccesses ()
 
float getPublishSuccessPercentage ()
 
 Publisher ()
 
bool shutdown () override
 
 ~Publisher () override=default
 
- Public Member Functions inherited from Aws::DataFlow::IPublisher< T >
virtual UploadStatus attemptPublish (T &batch_data)=0
 
- Public Member Functions inherited from Service
ServiceState getState ()
 
virtual std::string getStatusString ()
 
 Service ()
 
virtual ~Service ()=default
 

Private Attributes

Aws::SDKOptions aws_sdk_options_
 
Aws::Client::ClientConfiguration client_config_
 
std::shared_ptr< Aws::CloudWatchMetrics::Utils::CloudWatchMetricsFacadecloudwatch_metrics_facade_
 
std::string metrics_namespace_
 
std::recursive_mutex mtx_
 

Additional Inherited Members

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

Detailed Description

Class that handles sending metrics data to CloudWatch This class is responsible for emitting all the stored metrics to AWS CloudWatch. Metrics are published asynchronously using a thread. The thread waits on a condition variable and is signaled (by AWSCloudWatchMetricManager) whenever new metrics are available.

Definition at line 39 of file metric_publisher.hpp.

Constructor & Destructor Documentation

Aws::CloudWatchMetrics::MetricPublisher::MetricPublisher ( const std::string &  metrics_namespace,
const Aws::Client::ClientConfiguration &  client_config 
)

Definition at line 34 of file metric_publisher.cpp.

Aws::CloudWatchMetrics::MetricPublisher::MetricPublisher ( const std::string &  metrics_namespace,
std::shared_ptr< Utils::CloudWatchMetricsFacade cloudwatch_metrics_facade 
)
Aws::CloudWatchMetrics::MetricPublisher::~MetricPublisher ( )
overridedefault

Tears down the MetricPublisher object.

Member Function Documentation

Aws::DataFlow::UploadStatus Aws::CloudWatchMetrics::MetricPublisher::publishData ( MetricDatumCollection data)
overridevirtual

Attempt to publish the input data.

Parameters
datainput to publish to CloudWatch
Returns
the resulting Aws::DataFlow::UploadStatus from the publish attempt

Implements Publisher< MetricDatumCollection >.

Definition at line 61 of file metric_publisher.cpp.

bool Aws::CloudWatchMetrics::MetricPublisher::shutdown ( )
overridevirtual

Reimplemented from Service.

Definition at line 57 of file metric_publisher.cpp.

bool Aws::CloudWatchMetrics::MetricPublisher::start ( )
overridevirtual

Create the cloudwatch facade

Returns

Reimplemented from Service.

Definition at line 49 of file metric_publisher.cpp.

Member Data Documentation

Aws::SDKOptions Aws::CloudWatchMetrics::MetricPublisher::aws_sdk_options_
private

Definition at line 71 of file metric_publisher.hpp.

Aws::Client::ClientConfiguration Aws::CloudWatchMetrics::MetricPublisher::client_config_
private

Definition at line 70 of file metric_publisher.hpp.

std::shared_ptr<Aws::CloudWatchMetrics::Utils::CloudWatchMetricsFacade> Aws::CloudWatchMetrics::MetricPublisher::cloudwatch_metrics_facade_
private

Definition at line 68 of file metric_publisher.hpp.

std::string Aws::CloudWatchMetrics::MetricPublisher::metrics_namespace_
private

Definition at line 72 of file metric_publisher.hpp.

std::recursive_mutex Aws::CloudWatchMetrics::MetricPublisher::mtx_
mutableprivate

Definition at line 73 of file metric_publisher.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