#include <log_batcher.h>
Public Member Functions | |
void | emptyCollection () override |
LogBatcher (size_t max_allowable_batch_size=DataBatcher::kDefaultMaxBatchSize, size_t publish_trigger_size=DataBatcher::kDefaultTriggerSize) | |
Creates a new LogBatcher Creates a new LogBatcher that will group/buffer logs. Note: logs are only automatically published if the size is set, otherwise the publishBatchedData is necesary to push data to be published. More... | |
LogBatcher (const LogBatcher &other)=delete | |
LogBatcher & | operator= (const LogBatcher &other)=delete |
bool | publishBatchedData () override |
Services the log manager by performing periodic tasks when called. Calling the Service function allows for periodic tasks associated with the log manager, such as flushing buffered logs, to be performed. More... | |
virtual void | setLogFileManager (std::shared_ptr< Aws::FileManagement::FileManager< LogCollection >> log_file_manager) |
bool | start () override |
~LogBatcher () override | |
Tears down a LogBatcher object. More... | |
![]() | |
std::shared_ptr< Sink< Aws::FileManagement::TaskPtr< LogCollection > > > | getSink () |
std::enable_if< std::is_base_of< Sink< Aws::FileManagement::TaskPtr< LogCollection > >, T >::value, std::shared_ptr< T > >::type | setSink (std::shared_ptr< T > sink) |
![]() | |
virtual bool | batchData (const LogType &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 | |
![]() | |
ServiceState | getState () |
virtual std::string | getStatusString () |
Service () | |
virtual | ~Service ()=default |
Private Attributes | |
std::shared_ptr< Aws::FileManagement::FileManager< LogCollection > > | log_file_manager_ |
Additional Inherited Members | |
![]() | |
static void | validateConfigurableSizes (size_t batch_max_queue_size, size_t batch_trigger_publish_size) |
![]() | |
static const size_t | kDefaultMaxBatchSize |
static const size_t | kDefaultTriggerSize |
![]() | |
void | setState (ServiceState new_state) |
![]() | |
std::shared_ptr< std::list< LogType > > | batched_data_ |
std::recursive_mutex | mtx |
Definition at line 36 of file log_batcher.h.
|
explicit |
Creates a new LogBatcher Creates a new LogBatcher that will group/buffer logs. Note: logs are only automatically published if the size is set, otherwise the publishBatchedData is necesary to push data to be published.
invalid | argument if publish_trigger_size is strictly greater than max_allowable_batch_size |
size | of the batched data that will trigger a publish |
Definition at line 38 of file log_batcher.cpp.
|
delete |
|
overridedefault |
Tears down a LogBatcher object.
|
overridevirtual |
Override default behavior to attempt to write to file to disk when emptying the collection.
Reimplemented from DataBatcher< LogType >.
Definition at line 118 of file log_batcher.cpp.
|
delete |
|
overridevirtual |
Services the log manager by performing periodic tasks when called. Calling the Service function allows for periodic tasks associated with the log manager, such as flushing buffered logs, to be performed.
Implements DataBatcher< LogType >.
Definition at line 45 of file log_batcher.cpp.
|
virtual |
Set the log file manager, used for task publishing failures (write to disk if unable to send to CloudWatch).
invalid | argument if the input is null |
log_file_manager |
Definition at line 138 of file log_batcher.cpp.
|
overridevirtual |
Reimplemented from Service.
Definition at line 131 of file log_batcher.cpp.
|
private |
Definition at line 87 of file log_batcher.h.