AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MetricRecorder.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_METRICS_METRICRECORDER_INCLUDE_METRICS_METRICRECORDER_H_
16 #define ALEXA_CLIENT_SDK_METRICS_METRICRECORDER_INCLUDE_METRICS_METRICRECORDER_H_
17 
18 #include <unordered_set>
19 
23 
24 namespace alexaClientSDK {
25 namespace metrics {
26 namespace implementations {
27 
32 public:
39  static std::shared_ptr<MetricRecorderInterface> createMetricRecorderInterface(
40  std::unique_ptr<alexaClientSDK::avsCommon::utils::metrics::MetricSinkInterface> sink);
41 
45  virtual ~MetricRecorder() = default;
46 
54  bool addSink(std::unique_ptr<alexaClientSDK::avsCommon::utils::metrics::MetricSinkInterface> sink);
55 
58  void recordMetric(std::shared_ptr<alexaClientSDK::avsCommon::utils::metrics::MetricEvent> metricEvent) override;
60 
61 private:
62  // Unordered set of sinks
63  std::unordered_set<std::unique_ptr<alexaClientSDK::avsCommon::utils::metrics::MetricSinkInterface>> m_sinks;
64 
65  // Executor to perform asynchronous operation for recording metric
67 };
68 
69 } // namespace implementations
70 } // namespace metrics
71 } // namespace alexaClientSDK
72 
73 #endif // ALEXA_CLIENT_SDK_METRICS_METRICRECORDER_INCLUDE_METRICS_METRICRECORDER_H_
bool addSink(std::unique_ptr< alexaClientSDK::avsCommon::utils::metrics::MetricSinkInterface > sink)
Single-thread executor implementation.
Definition: Executor.h:45
void recordMetric(std::shared_ptr< alexaClientSDK::avsCommon::utils::metrics::MetricEvent > metricEvent) override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
static std::shared_ptr< MetricRecorderInterface > createMetricRecorderInterface(std::unique_ptr< alexaClientSDK::avsCommon::utils::metrics::MetricSinkInterface > sink)

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