20 #include <aws/core/utils/xml/XmlSerializer.h> 25 #include <aws/core/utils/json/JsonSerializer.h> 26 #include <aws/core/utils/logging/LogMacros.h> 30 namespace CloudWatchMetrics {
39 {
return metric1.GetTimestamp() < metric2.GetTimestamp(); };
41 std::set<MetricDatum, decltype(metric_comparison)> metrics_set(metric_comparison);
43 std::list<FileManagement::DataToken> data_tokens;
44 AWS_LOG_INFO(__func__,
"Reading Logbatch");
45 size_t actual_batch_size = 0;
47 for (
size_t i = 0; i < batch_size; ++i) {
49 if (!file_manager_strategy_->isDataAvailable()) {
50 AWS_LOG_DEBUG(__func__,
"No more metric data available on disk");
53 data_token = read(line);
54 Aws::String aws_line(line.c_str());
58 }
catch (std::invalid_argument &e) {
59 AWS_LOG_ERROR(__func__, e.what());
63 metrics_set.insert(metric_datum);
64 data_tokens.push_back(data_token);
67 FileObject<MetricDatumCollection> file_object;
68 file_object.batch_data = metrics_data;
69 file_object.batch_size = actual_batch_size;
70 file_object.data_tokens = data_tokens;
77 file_manager_strategy_->write(metric_serial.c_str());
79 if (FileManager::file_status_monitor_) {
80 AWS_LOG_DEBUG(__func__,
81 "Set file status available");
82 FileManager::file_status_monitor_->setStatus(Aws::DataFlow::Status::AVAILABLE);
std::list< Aws::CloudWatch::Model::MetricDatum > MetricDatumCollection
void write(const MetricDatumCollection &data) override
FileObject< MetricDatumCollection > readBatch(size_t batch_size) override
Aws::String serializeMetricDatum(const MetricDatum &datum)
Aws::CloudWatch::Model::MetricDatum MetricDatum
MetricDatum deserializeMetricDatum(const Aws::String &basic_string)