AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MetricEvent.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_METRICS_METRICEVENT_H_
16 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_METRICS_METRICEVENT_H_
17 
18 #include <unordered_map>
19 #include <vector>
20 
24 
25 namespace alexaClientSDK {
26 namespace avsCommon {
27 namespace utils {
28 namespace metrics {
29 
33 class MetricEvent {
34 public:
44  const std::string& activityName,
45  Priority priority,
46  const std::unordered_map<std::string, DataPoint>& dataPoints,
47  std::chrono::steady_clock::time_point timestamp);
48 
54  std::string getActivityName() const;
55 
61  Priority getPriority() const;
62 
70  Optional<DataPoint> getDataPoint(const std::string& name, DataType dataType) const;
71 
77  std::vector<DataPoint> getDataPoints() const;
78 
84  std::chrono::system_clock::time_point getTimestamp() const;
85 
90  std::chrono::steady_clock::time_point getSteadyTimestamp() const;
91 
92 private:
93  // The activity name of the metric event
94  const std::string m_activityName;
95 
96  // The priority of the metric event
97  const Priority m_priority;
98 
99  // The dataPoints of the metric event
100  const std::unordered_map<std::string, DataPoint> m_dataPoints;
101 
102  // The timestamp for when the metric event was created
103  const std::chrono::steady_clock::time_point m_timestamp;
104 };
105 
106 } // namespace metrics
107 } // namespace utils
108 } // namespace avsCommon
109 } // namespace alexaClientSDK
110 
111 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_METRICS_METRICEVENT_H_
std::chrono::system_clock::time_point getTimestamp() const
Definition: MetricEvent.cpp:75
Priority getPriority() const
Definition: MetricEvent.cpp:52
MetricEvent(const std::string &activityName, Priority priority, const std::unordered_map< std::string, DataPoint > &dataPoints, std::chrono::steady_clock::time_point timestamp)
Definition: MetricEvent.cpp:37
Optional< DataPoint > getDataPoint(const std::string &name, DataType dataType) const
Definition: MetricEvent.cpp:56
std::string getActivityName() const
Definition: MetricEvent.cpp:48
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::vector< DataPoint > getDataPoints() const
Definition: MetricEvent.cpp:66
std::chrono::steady_clock::time_point getSteadyTimestamp() const
Definition: MetricEvent.cpp:80

AlexaClientSDK 1.26.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0