Metrics manager handles direct or batch sending metrics to backend.
More...
#include <MetricsManager.h>
|
|
static const unsigned int | DesiredMaxWorkers = 2 |
| |
Metrics manager handles direct or batch sending metrics to backend.
◆ GetGlobalStatistics()
| const GlobalStatistics & AWSMetrics::MetricsManager::GetGlobalStatistics |
( |
| ) |
const |
Retrieve the global statistics for sending metrics.
- Returns
- Global statistics for sending metrics
◆ GetMetricsFileDirectory()
| const char * AWSMetrics::MetricsManager::GetMetricsFileDirectory |
( |
| ) |
const |
Get the directory of the local metrics file.
- Returns
- Directory of the local metrics file.
◆ GetMetricsFilePath()
| const char * AWSMetrics::MetricsManager::GetMetricsFilePath |
( |
| ) |
const |
Get the path to the local metrics file.
- Returns
- Path to the local metrics file.
◆ GetNumBufferedMetrics()
| AZ::s64 AWSMetrics::MetricsManager::GetNumBufferedMetrics |
( |
| ) |
|
Get the total number of metrics buffered in the metrics queue.
- Returns
- the number of buffered metrics
◆ GetNumTotalRequests()
| int AWSMetrics::MetricsManager::GetNumTotalRequests |
( |
| ) |
const |
Get the total number of requests for sending metrics events. This value could be different to the number of submitted metrics events since metrics events could be sent in batch.
- Returns
- Total number of requests for sending metrics events.
◆ Init()
| bool AWSMetrics::MetricsManager::Init |
( |
| ) |
|
Initializing the metrics manager
- Returns
- Whether the operation is successful.
◆ OnResponseReceived()
| void AWSMetrics::MetricsManager::OnResponseReceived |
( |
const MetricsQueue & | metricsEventsInRequest, |
|
|
const ServiceAPI::PostMetricsEventsResponseEntries & | responseEntries = ServiceAPI::PostMetricsEventsResponseEntries() ) |
Update the global stats and add qualified failed metrics events back to the buffer for retry.
- Parameters
-
| metricsEventsInRequest | Metrics events in the original request. |
| responseEntries | Response list for all the processed metrics events. |
◆ SendMetricsAsync()
| bool AWSMetrics::MetricsManager::SendMetricsAsync |
( |
const AZStd::vector< MetricsAttribute > & | metricsAttributes = AZStd::vector< MetricsAttribute >(), |
|
|
int | eventPriority = 0, |
|
|
const AZStd::string & | eventSourceOverride = "" ) |
Implementation for sending metrics asynchronously.
- Parameters
-
| metricsAttributes | Attributes of the metrics. |
| eventSourceOverride | Event source used to override the default value. |
| eventPriority | Priority of the event. Default to 0 which is considered as the highest priority. |
- Returns
- Whether the request is sent successfully.
◆ SendMetricsToFile()
| virtual AZ::Outcome< void, AZStd::string > AWSMetrics::MetricsManager::SendMetricsToFile |
( |
AZStd::shared_ptr< MetricsQueue > | metricsQueue | ) |
|
|
protectedvirtual |
Send metrics to a local file.
- Parameters
-
| metricsQueue | metricsQueue Metrics queue that stores the metrics. |
- Returns
- Outcome of the operation.
◆ SubmitMetrics()
| bool AWSMetrics::MetricsManager::SubmitMetrics |
( |
const AZStd::vector< MetricsAttribute > & | metricsAttributes = AZStd::vector< MetricsAttribute >(), |
|
|
int | eventPriority = 0, |
|
|
const AZStd::string & | eventSourceOverride = "" ) |
Implementation for submitting metrics. Metrics will be buffered before sending in batch.
- Parameters
-
| metricsAttributes | Attributes of the metrics. |
| eventPriority | Priority of the event. Default to 0 which is considered as the highest priority. |
| eventSourceOverride | Event source used to override the default value. |
- Returns
- Whether the submission is successful.
◆ UpdateOfflineRecordingStatus()
| void AWSMetrics::MetricsManager::UpdateOfflineRecordingStatus |
( |
bool | enable, |
|
|
bool | submitLocalMetrics = false ) |
Enable/Disable the offline recording and resubmit metrics stored in the local metrics file if the client switches to the online mode.
- Parameters
-
| enable | Whether to enable the offline recording. |
| submitLocalMetrics | Whether to resubmit local metrics if exist. |
The documentation for this class was generated from the following file:
- Gems/AWSMetrics/Code/Source/MetricsManager.h