AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
UplData.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 
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_METRICS_UPLDATA_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_METRICS_UPLDATA_H_
18 
19 #include <chrono>
20 #include <string>
21 #include <unordered_map>
22 
23 namespace alexaClientSDK {
24 namespace avsCommon {
25 namespace utils {
26 namespace metrics {
27 
31 class UplData {
32 public:
34  using UplTimePoint = std::chrono::steady_clock::time_point;
35 
43  void addTimepoint(const std::string& name, const UplTimePoint& timepoint);
44 
51  UplTimePoint getTimepoint(const std::string& name) const;
52 
60  void addParseCompleteTimepoint(const std::string& directiveId, const UplTimePoint& timepoint);
61 
68  UplTimePoint getParseCompleteTimepoint(const std::string& directiveId) const;
69 
78  void addDirectiveDispatchedTimepoint(const std::string& directiveId, const UplTimePoint& timepoint);
79 
88 
96  void addStringData(const std::string& name, const std::string& data);
97 
104  std::string getStringData(const std::string& name) const;
105 
106 private:
108  std::unordered_map<std::string, UplTimePoint> m_uplTimePointsMap;
109 
111  std::unordered_map<std::string, UplTimePoint> m_messageIdToParseCompleteMap;
112 
114  std::unordered_map<std::string, UplTimePoint> m_messageIdToDirectiveDispatchedMap;
115 
117  std::unordered_map<std::string, std::string> m_otherData;
118 };
119 
120 } // namespace metrics
121 } // namespace utils
122 } // namespace avsCommon
123 } // namespace alexaClientSDK
124 
125 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_METRICS_UPLDATA_H_
void addStringData(const std::string &name, const std::string &data)
void addParseCompleteTimepoint(const std::string &directiveId, const UplTimePoint &timepoint)
::std::string string
Definition: gtest-port.h:1097
UplTimePoint getParseCompleteTimepoint(const std::string &directiveId) const
std::chrono::steady_clock::time_point UplTimePoint
Alias for convenience.
Definition: UplData.h:34
UplTimePoint getTimepoint(const std::string &name) const
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::string getStringData(const std::string &name) const
void addDirectiveDispatchedTimepoint(const std::string &directiveId, const UplTimePoint &timepoint)
void addTimepoint(const std::string &name, const UplTimePoint &timepoint)
UplTimePoint getDirectiveDispatchedTimepoint(const std::string &directiveId) const

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