#include <metric_service.hpp>
Public Member Functions | |
MetricDatum | convertInputToBatched (const Utils::MetricObject &input, const std::chrono::milliseconds &milliseconds) override |
MetricDatum | convertInputToBatched (const Utils::MetricObject &input) override |
MetricService (std::shared_ptr< Publisher< MetricDatumCollection >> publisher, std::shared_ptr< DataBatcher< MetricDatum >> batcher, std::shared_ptr< Aws::FileManagement::FileUploadStreamer< MetricDatumCollection >> file_upload_streamer=nullptr) | |
Public Member Functions inherited from Aws::CloudWatch::CloudWatchService< Utils::MetricObject, MetricDatum > | |
virtual bool | batchData (const D &data_to_batch) |
virtual bool | batchData (const D &data_to_batch, const std::chrono::milliseconds &milliseconds) |
CloudWatchService (std::shared_ptr< Publisher< std::list< T >>> publisher, std::shared_ptr< DataBatcher< T >> batcher) | |
virtual std::chrono::milliseconds | getCurrentTimestamp () |
virtual std::chrono::milliseconds | getDequeueDuration () |
int | getNumberDequeued () |
virtual bool | isConnected () |
virtual bool | publishBatchedData () |
virtual bool | setDequeueDuration (std::chrono::milliseconds new_value) |
virtual bool | shutdown () |
virtual bool | start () override |
~CloudWatchService ()=default | |
Public Member Functions inherited from InputStage< TaskPtr< std::list< T > > > | |
std::shared_ptr< Source< TaskPtr< std::list< T > > > > | getSource () |
void | setSource (std::shared_ptr< Source< TaskPtr< std::list< T > > >> source) |
Public Member Functions inherited from RunnableService | |
std::string | getStatusString () override |
virtual bool | isRunning () |
void | join () |
RunnableService () | |
void | waitForShutdown (std::chrono::milliseconds millis) |
void | waitForShutdown () |
~RunnableService () override=default | |
Public Member Functions inherited from Service | |
ServiceState | getState () |
Service () | |
virtual | ~Service ()=default |
Additional Inherited Members | |
Protected Member Functions inherited from Aws::CloudWatch::CloudWatchService< Utils::MetricObject, MetricDatum > | |
virtual T | convertInputToBatched (const D &input, const std::chrono::milliseconds &milliseconds)=0 |
virtual T | convertInputToBatched (const D &input)=0 |
void | work () |
Protected Member Functions inherited from RunnableService | |
virtual void | run () |
virtual bool | startWorkerThread () |
virtual bool | stopWorkerThread () |
Protected Member Functions inherited from Service | |
void | setState (ServiceState new_state) |
Protected Attributes inherited from Aws::CloudWatch::CloudWatchService< Utils::MetricObject, MetricDatum > | |
std::shared_ptr< DataBatcher< T > > | batcher_ |
std::chrono::milliseconds | dequeue_duration_ |
std::shared_ptr< FileUploadStreamer< std::list< T > > > | file_upload_streamer_ |
std::shared_ptr< Publisher< std::list< T > > > | publisher_ |
Implementation to send metrics to CloudWatch. Note: though the batcher and publisher are required, the file streamer is not. If the file streamer is not provided then metric data is dropped if any failure is observed during the attempt to publish.
Definition at line 46 of file metric_service.hpp.
|
inline |
Construct a new instance of MetricService.
publisher | used to publish metrics to CloudWatch |
batcher | used to batch / queue metrics before publishing |
file_upload_streamer | used to save metric data and upload later in the event of network connectivity changes |
Definition at line 57 of file metric_service.hpp.
|
inlineoverride |
Convert an input MetricObject (provided but the user) to the specific AWS SDK type.
input | MetricObject to convert |
milliseconds | timestamp to use for metric |
Definition at line 73 of file metric_service.hpp.
|
inlineoverride |
Convert an input MetricObject (provided but the user) to the specific AWS SDK type.
input | MetricObject to convert |
Definition at line 86 of file metric_service.hpp.