AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <MediaUplCalculator.h>
Public Member Functions | |
virtual | ~MediaUplCalculator ()=default |
std::shared_ptr< alexaClientSDK::avsCommon::utils::metrics::UplData > | getUplData () const |
Overridden UplCaclulatorInterface method. | |
void | inspectMetric (const std::shared_ptr< alexaClientSDK::avsCommon::utils::metrics::MetricEvent > &metricEvent) override |
void | setUplData (const std::shared_ptr< alexaClientSDK::avsCommon::utils::metrics::UplData > &uplData) override |
Public Member Functions inherited from alexaClientSDK::avsCommon::utils::metrics::UplCalculatorInterface | |
virtual | ~UplCalculatorInterface ()=default |
virtual void | inspectMetric (const std::shared_ptr< avsCommon::utils::metrics::MetricEvent > &metricEvent)=0 |
Static Public Member Functions | |
static std::unique_ptr< avsCommon::utils::metrics::UplCalculatorInterface > | createMediaUplCalculator (std::shared_ptr< alexaClientSDK::avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder) |
Additional Inherited Members | |
Public Types inherited from alexaClientSDK::avsCommon::utils::metrics::UplCalculatorInterface | |
using | UplTimePoint = std::chrono::steady_clock::time_point |
Alias for convenience. More... | |
Protected Attributes inherited from alexaClientSDK::avsCommon::utils::metrics::UplCalculatorInterface | |
std::shared_ptr< UplData > | m_uplData |
This class implements a sample UPL calculator that calculates the time to a media related response, for example starting or stopping music. MediaUplCalculator needs BaseUplCalculator to be also running for it to calculate UPL correctly.
MediaUplCalculator separates Media UPL in three categories: PLAY, STOP, and PLAY_AFTER_TTS. Upon receiving the PLAYBACK_STARTED or PLAYBACK_STOPPED metric, if a TTS response played it substracts the TTS response's duration from the UPL duration then calculates UPL.
|
virtualdefault |
Destructor
|
static |
Create a MediaUplCalculator
.
metricRecorder | is the MetricRecorder object to publish UPL metrics to. |
MediaUplCalculator
. std::shared_ptr<alexaClientSDK::avsCommon::utils::metrics::UplData> alexaClientSDK::metrics::implementations::MediaUplCalculator::getUplData | ( | ) | const |
Returns the pointer to the collected UplData
UplData
|
override |
|
overridevirtual |
Sets the uplData to the given pointer.
uplData | Object to record in. |
Implements alexaClientSDK::avsCommon::utils::metrics::UplCalculatorInterface.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0