MetricsQueue is used to buffer the submitted metrics before sending them in batch to the backend or local file.
More...
#include <MetricsQueue.h>
MetricsQueue is used to buffer the submitted metrics before sending them in batch to the backend or local file.
◆ AddMetrics()
void AWSMetrics::MetricsQueue::AddMetrics |
( |
const MetricsEvent & |
metrics | ) |
|
Add a new metrics to the queue.
- Parameters
-
◆ AppendMetrics()
void AWSMetrics::MetricsQueue::AppendMetrics |
( |
MetricsQueue & |
metricsQueue | ) |
|
Append an existing metrics queue to the current queue.
- Parameters
-
metricsQueue | metrics queue to append. |
◆ ClearMetrics()
void AWSMetrics::MetricsQueue::ClearMetrics |
( |
| ) |
|
Empty the metrics queue. Unsubmitted metrics will be lost after this operation.
◆ FilterMetricsByPriority()
int AWSMetrics::MetricsQueue::FilterMetricsByPriority |
( |
size_t |
maxSizeInBytes | ) |
|
Filter out lower priority metrics event in the queue if the queue size reaches the maximum capacity.
- Parameters
-
maxSizeInBytes | Maximum capacity of the queue. |
- Returns
- Total number of metrics events dropped because of the size limit.
◆ GetSizeInBytes()
size_t AWSMetrics::MetricsQueue::GetSizeInBytes |
( |
| ) |
const |
Get the total size of all the metrics inside the queue.
- Returns
- size of the queue in bytes
◆ PopBufferedEventsByServiceLimits()
void AWSMetrics::MetricsQueue::PopBufferedEventsByServiceLimits |
( |
MetricsQueue & |
bufferedEvents, |
|
|
int |
maxPayloadSizeInMb, |
|
|
int |
maxBatchedRecordsCount |
|
) |
| |
Pop buffered metrics events by the payload size and record count limits and add them to a new queue.
- Parameters
-
bufferedEvents | The metrics queue to store poped metrics events. |
maxPayloadSizeInMb | Maximum size for the service API request payload. |
maxBatchedRecordsCount | Maximum number of records sent in a service API request. |
◆ PushMetricsToFront()
void AWSMetrics::MetricsQueue::PushMetricsToFront |
( |
MetricsQueue & |
metricsQueue | ) |
|
Push an existing metrics queue to the front of the current queue.
- Parameters
-
metricsQueue | metrics queue to push. |
◆ ReadFromJson()
bool AWSMetrics::MetricsQueue::ReadFromJson |
( |
const AZStd::string & |
filePath | ) |
|
Read from a local JSON file to the metrics queue.
- Parameters
-
filePath | Path to the local JSON file. |
- Returns
- Whether the metrics queue is created successfully.
◆ SerializeToJson() [1/2]
AZStd::string AWSMetrics::MetricsQueue::SerializeToJson |
( |
| ) |
|
Serialize the metrics events queue to a string.
- Returns
- Serialized string.
◆ SerializeToJson() [2/2]
bool AWSMetrics::MetricsQueue::SerializeToJson |
( |
AWSCore::JsonWriter & |
writer | ) |
const |
Serialize the metrics queue to JSON for sending requests.
- Parameters
-
writer | JSON writer for the serialization. |
- Returns
- Whether the metrics queue is serialized successfully.
The documentation for this class was generated from the following file:
- Gems/AWSMetrics/Code/Source/MetricsQueue.h