Alexa Auto SDK  2.0.0
MetricsUploader.h
1 /*
2  * Copyright 2017-2019 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:
34 
38  enum class DatapointType {
42  TIMER,
46  STRING,
50  COUNTER
51  };
52 
56  class Datapoint {
57  public:
58  Datapoint( DatapointType type, std::string name, std::string value, int count );
59  DatapointType getType() const {return m_type;}
60  std::string getName() const {return m_name;}
61  std::string getValue() const {return m_value;}
62  int getCount() const {return m_count;}
63 
64  private:
65  DatapointType m_type;
66  std::string m_name;
67  std::string m_value;
68  int m_count;
69  };
70 
71 protected:
72  MetricsUploader() = default;
73 
74 public:
75  virtual ~MetricsUploader();
76 
85  virtual bool record( const std::vector<Datapoint>& datapoints, const std::unordered_map<std::string, std::string>& metadata ) = 0;
86 };
87 
88 } // aace::metrics
89 } // aace
90 
91 #endif // AACE_METRICS_METRICS_UPLOADER_H
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26
Definition: MetricsUploader.h:32
Definition: MetricsUploader.h:56
virtual bool record(const std::vector< Datapoint > &datapoints, const std::unordered_map< std::string, std::string > &metadata)=0
DatapointType
Definition: MetricsUploader.h:38

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