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

#include <metric_batcher.h>

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

Public Member Functions

void emptyCollection () override
 
 MetricBatcher (size_t max_allowable_batch_size=DataBatcher::kDefaultMaxBatchSize, size_t publish_trigger_size=DataBatcher::kDefaultTriggerSize)
 Creates a new MetricBatcher Creates a new MetricBatcher that will group/buffer metrics. Note: metrics are only automatically published if the size is set, otherwise the publishBatchedData is necessary to push data to be published. More...
 
 MetricBatcher (const MetricBatcher &other)=delete
 
MetricBatcheroperator= (const MetricBatcher &other)=delete
 
bool publishBatchedData () override
 
virtual void setMetricFileManager (std::shared_ptr< Aws::FileManagement::FileManager< MetricDatumCollection >> file_manager)
 
bool start () override
 
 ~MetricBatcher () override
 Tears down a MetricBatcher object. More...
 
- Public Member Functions inherited from DataBatcher< MetricDatum >
virtual bool batchData (const MetricDatum &data_to_batch)
 
 DataBatcher (size_t max_allowable_batch_size=DataBatcher::kDefaultMaxBatchSize, size_t trigger_size=DataBatcher::kDefaultTriggerSize, std::chrono::microseconds try_enqueue_duration=std::chrono::duration_cast< std::chrono::microseconds >(std::chrono::seconds(2)))
 
size_t getCurrentBatchSize ()
 
size_t getMaxAllowableBatchSize ()
 
size_t getTriggerBatchSize ()
 
std::chrono::microseconds getTryEnqueueDuration ()
 
void resetBatchedData ()
 
void resetTriggerBatchSize ()
 
void setMaxAllowableBatchSize (int new_value)
 
void setTriggerBatchSize (size_t new_value)
 
void setTryEnqueueDuration (std::chrono::microseconds duration)
 
bool shutdown () override
 
 ~DataBatcher () override=default
 
- Public Member Functions inherited from Service
ServiceState getState ()
 
virtual std::string getStatusString ()
 
 Service ()
 
virtual ~Service ()=default
 
- Public Member Functions inherited from Aws::DataFlow::OutputStage< Aws::FileManagement::TaskPtr< MetricDatumCollection > >
std::shared_ptr< Sink< Aws::FileManagement::TaskPtr< MetricDatumCollection > > > getSink ()
 
std::enable_if< std::is_base_of< Sink< Aws::FileManagement::TaskPtr< MetricDatumCollection > >, T >::value, std::shared_ptr< T > >::type setSink (std::shared_ptr< T > sink)
 

Private Attributes

std::shared_ptr< Aws::FileManagement::FileManager< MetricDatumCollection > > metric_file_manager_
 

Additional Inherited Members

- Static Public Member Functions inherited from DataBatcher< MetricDatum >
static void validateConfigurableSizes (size_t batch_max_queue_size, size_t batch_trigger_publish_size)
 
- Static Public Attributes inherited from DataBatcher< MetricDatum >
static const size_t kDefaultMaxBatchSize
 
static const size_t kDefaultTriggerSize
 
- Protected Member Functions inherited from Service
void setState (ServiceState new_state)
 
- Protected Attributes inherited from DataBatcher< MetricDatum >
std::shared_ptr< std::list< MetricDatum > > batched_data_
 
std::recursive_mutex mtx
 

Detailed Description

Definition at line 35 of file metric_batcher.h.

Constructor & Destructor Documentation

Aws::CloudWatchMetrics::MetricBatcher::MetricBatcher ( size_t  max_allowable_batch_size = DataBatcher::kDefaultMaxBatchSize,
size_t  publish_trigger_size = DataBatcher::kDefaultTriggerSize 
)
explicit

Creates a new MetricBatcher Creates a new MetricBatcher that will group/buffer metrics. Note: metrics are only automatically published if the size is set, otherwise the publishBatchedData is necessary to push data to be published.

Exceptions
invalidargument if publish_trigger_size is strictly greater than max_allowable_batch_size
Parameters
sizeof the batched data that will trigger a publish

Definition at line 39 of file metric_batcher.cpp.

Aws::CloudWatchMetrics::MetricBatcher::MetricBatcher ( const MetricBatcher other)
delete
Aws::CloudWatchMetrics::MetricBatcher::~MetricBatcher ( )
overridedefault

Tears down a MetricBatcher object.

Member Function Documentation

void Aws::CloudWatchMetrics::MetricBatcher::emptyCollection ( )
overridevirtual

Override default behavior to attempt to write to file to disk when emptying the collection.

Reimplemented from DataBatcher< MetricDatum >.

Definition at line 119 of file metric_batcher.cpp.

MetricBatcher& Aws::CloudWatchMetrics::MetricBatcher::operator= ( const MetricBatcher other)
delete
bool Aws::CloudWatchMetrics::MetricBatcher::publishBatchedData ( )
overridevirtual

Queue the batched data to be given to the publisher and sent to CloudWatch. Attempts to write to disk (through the FileManager) if unable to publish.

Returns
true if the batched data could be queued, false otherwise

Implements DataBatcher< MetricDatum >.

Definition at line 46 of file metric_batcher.cpp.

void Aws::CloudWatchMetrics::MetricBatcher::setMetricFileManager ( std::shared_ptr< Aws::FileManagement::FileManager< MetricDatumCollection >>  file_manager)
virtual

Set the log file manager, used for task publishing failures (write to disk if unable to send to CloudWatch).

Exceptions
invalidargument if the input is null
Parameters
log_file_manager

Definition at line 139 of file metric_batcher.cpp.

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

Start this service

Returns

Reimplemented from Service.

Definition at line 132 of file metric_batcher.cpp.

Member Data Documentation

std::shared_ptr<Aws::FileManagement::FileManager<MetricDatumCollection> > Aws::CloudWatchMetrics::MetricBatcher::metric_file_manager_
private

Definition at line 87 of file metric_batcher.h.


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