38 namespace CloudWatchMetrics {
42 const std::string & metrics_namespace,
43 const Aws::Client::ClientConfiguration & client_config,
44 const Aws::SDKOptions & sdk_options,
47 Aws::InitAPI(sdk_options);
51 auto metric_publisher = std::make_shared<MetricPublisher>(metrics_namespace, client_config);
54 std::make_shared<Aws::DataFlow::QueueMonitor<Aws::FileManagement::TaskPtr<MetricDatumCollection>>>();
61 auto metric_file_upload_streamer =
62 Aws::FileManagement::createFileUploadStreamer<MetricDatumCollection>(metric_file_manager, file_upload_options);
65 metric_publisher->addPublisherStateListener([upload_streamer = metric_file_upload_streamer](
const PublisherState& state) {
67 (state == PublisherState::CONNECTED) ? Aws::DataFlow::Status::AVAILABLE : Aws::DataFlow::Status::UNAVAILABLE;
68 upload_streamer->onPublisherStateChange(status);
72 auto file_data_queue =
77 metric_file_upload_streamer->setSink(file_data_queue);
80 auto metric_batcher = std::make_shared<MetricBatcher>(
84 metric_batcher->setMetricFileManager(metric_file_manager);
86 metric_batcher->setSink(stream_data_queue);
89 auto metric_service = std::make_shared<MetricService>(metric_publisher, metric_batcher, metric_file_upload_streamer);
90 metric_service->setSource(queue_monitor);
92 return metric_service;
Aws::FileManagement::FileManagerStrategyOptions file_manager_strategy_options
virtual std::shared_ptr< MetricService > createMetricService(const std::string &metrics_namespace, const Aws::Client::ClientConfiguration &client_config, const Aws::SDKOptions &sdk_options, const CloudWatchOptions &cloudwatch_options=kDefaultCloudWatchOptions)
size_t batch_max_queue_size
size_t batch_trigger_publish_size
size_t file_upload_batch_size
size_t stream_max_queue_size
Aws::DataFlow::ObservedBlockingQueue< TaskPtr< T >> TaskObservedBlockingQueue
Aws::DataFlow::UploaderOptions uploader_options
size_t file_max_queue_size
Class that handles sending metrics data to CloudWatch This class is responsible for emitting all the ...