Alexa Auto SDK  2.3.1
MetricsUploader.h
1 /*
2  * Copyright 2017-2020 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 AACE_METRICS_METRICS_UPLOADER_H
17 #define AACE_METRICS_METRICS_UPLOADER_H
18 
19 #include "AACE/Core/PlatformInterface.h"
20 #include <unordered_map>
21 #include <string>
22 #include <vector>
23 
26 namespace aace {
27 namespace metrics {
28 
33 public:
37  enum class DatapointType {
41  TIMER,
45  STRING,
49  COUNTER
50  };
51 
55  class Datapoint {
56  public:
57  Datapoint(DatapointType type, std::string name, std::string value, int count);
58  DatapointType getType() const {
59  return m_type;
60  }
61  std::string getName() const {
62  return m_name;
63  }
64  std::string getValue() const {
65  return m_value;
66  }
67  int getCount() const {
68  return m_count;
69  }
70 
71  private:
72  DatapointType m_type;
73  std::string m_name;
74  std::string m_value;
75  int m_count;
76  };
77 
78 protected:
79  MetricsUploader() = default;
80 
81 public:
82  virtual ~MetricsUploader();
83 
92  virtual bool record(
93  const std::vector<Datapoint>& datapoints,
94  const std::unordered_map<std::string, std::string>& metadata) = 0;
95 };
96 
97 } // namespace metrics
98 } // namespace aace
99 
100 #endif // AACE_METRICS_METRICS_UPLOADER_H
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26
Definition: MetricsUploader.h:32
Definition: MetricsUploader.h:55
virtual bool record(const std::vector< Datapoint > &datapoints, const std::unordered_map< std::string, std::string > &metadata)=0
DatapointType
Definition: MetricsUploader.h:37

Alexa Auto SDK 2.3.1 - Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0