Integrating up through commit 90f050496

This commit is contained in:
alexpete
2021-04-07 14:03:29 -07:00
parent 8f2ed080a9
commit c2cbd430fe
2694 changed files with 285622 additions and 176874 deletions
@@ -15,35 +15,35 @@
namespace AWSMetrics
{
//! Default metrics attribute keys
static constexpr char METRICS_ATTRIBUTE_KEY_CLIENT_ID[] = "application_id";
static constexpr char METRICS_ATTRIBUTE_KEY_EVENT_ID[] = "event_id";
static constexpr char METRICS_ATTRIBUTE_KEY_EVENT_NAME[] = "event_name";
static constexpr char METRICS_ATTRIBUTE_KEY_EVENT_TYPE[] = "event_type";
static constexpr char METRICS_ATTRIBUTE_KEY_EVENT_SOURCE[] = "event_source";
static constexpr char METRICS_ATTRIBUTE_KEY_EVENT_TIMESTAMP[] = "event_timestamp";
static constexpr char AwsMetricsAttributeKeyClientId[] = "application_id";
static constexpr char AwsMetricsAttributeKeyEventId[] = "event_id";
static constexpr char AwsMetricsAttributeKeyEventName[] = "event_name";
static constexpr char AwsMetricsAttributeKeyEventType[] = "event_type";
static constexpr char AwsMetricsAttributeKeyEventSource[] = "event_source";
static constexpr char AwsMetricsAttributeKeyEventTimestamp[] = "event_timestamp";
static constexpr char METRICS_ATTRIBUTE_KEY_EVENT_DATA[] = "event_data";
static constexpr char AwsMetricsAttributeKeyEventData[] = "event_data";
//! Service API request and response object keys
static constexpr char SUCCESS_RESPONSE_RECORD_KEY_ERROR_CODE[] = "error_code";
static constexpr char SUCCESS_RESPONSE_RECORD_KEY_RESULT[] = "result";
static constexpr char SUCCESS_RESPONSE_KEY_FAILED_RECORD_COUNT[] = "failed_record_count";
static constexpr char SUCCESS_RESPONSE_KEY_EVENTS[] = "events";
static constexpr char SUCCESS_RESPONSE_KEY_TOTAL[] = "total";
static constexpr char ERROR_KEY_MESSAGE[] = "message";
static constexpr char ERROR_KEY_TYPE[] = "type";
static constexpr char REQUEST_PARAMETER_KEY_EVENTS[] = "events";
static constexpr char AwsMetricsSuccessResponseRecordKeyErrorCode[] = "error_code";
static constexpr char AwsMetricsSuccessResponseRecordKeyResult[] = "result";
static constexpr char AwsMetricsSuccessResponseKeyFailedRecordCount[] = "failed_record_count";
static constexpr char AwsMetricsSuccessResponseKeyEvents[] = "events";
static constexpr char AwsMetricsSuccessResponseKeyTotal[] = "total";
static constexpr char AwsMetricsErrorKeyMessage[] = "message";
static constexpr char AwsMetricsErrorKeyType[] = "type";
static constexpr char AwsMetricsRequestParameterKeyEvents[] = "events";
static constexpr char SUCCESS_RESPONSE_RECORD_RESULT[] = "Ok";
static constexpr char AwsMetricsSuccessResponseRecordResult[] = "Ok";
//! Service API limits
//! https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html
static constexpr int MAX_REST_API_PAYLOAD_SIZE_IN_MB = 10;
//! https://docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecordBatch.html
static constexpr int MAX_FIREHOSE_BATCHED_RECORDS_COUNT = 500;
static constexpr int AwsMetricsMaxRestApiPayloadSizeInMb = 10;
//! https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecords.html
static constexpr int AwsMetricsMaxKinesisBatchedRecordCount = 500;
//! Metrics event JSON schema
static constexpr const char METRICS_EVENT_JSON_SCHEMA[] =
static constexpr const char AwsMetricsEventJsonSchema[] =
R"({
"$schema": "http://json-schema.org/draft-04/schema",
"title": "AWSMetrics API Event Schema",
@@ -0,0 +1,33 @@
/*
* All or portions of this file Copyright(c) Amazon.com, Inc.or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <AzCore/Module/Module.h>
namespace AWSMetrics
{
class AWSMetricsModule
: public AZ::Module
{
public:
AZ_RTTI(AWSMetricsModule, "{A36566F3-E144-4188-A7E0-BAB45BCEA55F}", AZ::Module);
AZ_CLASS_ALLOCATOR(AWSMetricsModule, AZ::SystemAllocator, 0);
AWSMetricsModule();
~AWSMetricsModule() override = default;
/**
* Add required SystemComponents to the SystemEntity.
*/
virtual AZ::ComponentTypeList GetRequiredSystemComponents() const override;
};
}
@@ -15,8 +15,8 @@
namespace AWSMetrics
{
constexpr char metricsDir[] = "@user@/AWSMetrics/";
constexpr char metricsFileName[] = "metrics.json";
constexpr char AwsMetricsLocalFileDir[] = "@user@/AWSMetrics/";
constexpr char AwsMetricsLocalFileName[] = "metrics.json";
//! ClientConfiguration is used to retrieve and store client settings from a local configuration JSON file.
class ClientConfiguration
@@ -32,7 +32,7 @@ namespace AWSMetrics
class MetricsManager
{
public:
static const unsigned int desiredMaxWorkers = 2;
static const unsigned int DesiredMaxWorkers = 2;
MetricsManager();
~MetricsManager();
@@ -71,8 +71,6 @@ namespace AWSMetrics
//! @return Whether the metrics queue is created successfully.
bool ReadFromJson(const AZStd::string& filePath);
bool ReadFromString(const AZStd::string& string);
private:
bool ReadFromJsonDocument(rapidjson::Document& doc);