Open 3D Engine AWSMetrics Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AWSMetrics::MetricsAttribute Class Reference

#include <MetricsAttribute.h>

Public Member Functions

 MetricsAttribute (const AZStd::string &name, int intVal)
 
 MetricsAttribute (const AZStd::string &name, double doubleVal)
 
 MetricsAttribute (const AZStd::string &name, const AZStd::string &strVal)
 
void SetName (const AZStd::string &name)
 
AZStd::string GetName () const
 
void SetVal (const AZStd::string &val)
 
void SetVal (int val)
 
void SetVal (double val)
 
AZStd::variant< int, double, AZStd::string > GetVal () const
 
size_t GetSizeInBytes () const
 
bool IsDefault () const
 
bool SerializeToJson (AWSCore::JsonWriter &writer) const
 
bool ReadFromJson (const rapidjson::Value &name, const rapidjson::Value &val)
 

Detailed Description

MetricsAttribute represents one attribute of the metrics. Attribute value can be int, double or string. e.g. name: event_name, value: login

Member Function Documentation

◆ GetSizeInBytes()

size_t AWSMetrics::MetricsAttribute::GetSizeInBytes ( ) const

Get the metrics attribute size serialized to json.

Returns
metrics attribute size in bytes.

◆ IsDefault()

bool AWSMetrics::MetricsAttribute::IsDefault ( ) const

Check whether the attribute is one of the default attributes.

Returns
Whether the attribute is a default one.

◆ ReadFromJson()

bool AWSMetrics::MetricsAttribute::ReadFromJson ( const rapidjson::Value &  name,
const rapidjson::Value &  val 
)

Read from a JSON value to the metrics attribute.

Parameters
nameJSON value used for the attribute name.
nameJSON value used for the attribute value.
Returns
Whether the metrics attribute is created successfully

◆ SerializeToJson()

bool AWSMetrics::MetricsAttribute::SerializeToJson ( AWSCore::JsonWriter &  writer) const

Serialize the metrics attribute to JSON for sending requests.

Parameters
writerJSON writer for the serialization.
Returns
Whether the metrics attribute is serialized successfully.

The documentation for this class was generated from the following file: