diff options
Diffstat (limited to 'src/components/protocol_handler')
4 files changed, 9 insertions, 7 deletions
diff --git a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h index bac37b508c..84ec3c9e30 100644 --- a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h +++ b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h @@ -60,7 +60,7 @@ typedef uint32_t MessageID; struct ProtocolFrameData { ProtocolFramePtr frame; - TimevalStruct append_time; + date_time::TimeDuration append_time; }; /** *\brief Map of frames with last frame data for messages received in multiple diff --git a/src/components/protocol_handler/src/multiframe_builder.cc b/src/components/protocol_handler/src/multiframe_builder.cc index 5afae51292..c34e2ec640 100644 --- a/src/components/protocol_handler/src/multiframe_builder.cc +++ b/src/components/protocol_handler/src/multiframe_builder.cc @@ -124,7 +124,7 @@ ProtocolFramePtrList MultiFrameBuilder::PopMultiframes() { if (consecutive_frame_wait_msecs_ != 0) { LOG4CXX_TRACE(logger_, "Expiration verification"); const int64_t time_left = - date_time::DateTime::calculateTimeSpan(frame_data.append_time); + date_time::calculateTimeSpan(frame_data.append_time); LOG4CXX_DEBUG(logger_, "mSecs left: " << time_left); if (time_left >= consecutive_frame_wait_msecs_) { LOG4CXX_WARN(logger_, "Expired frame: " << frame); @@ -200,7 +200,7 @@ RESULT_CODE MultiFrameBuilder::HandleFirstFrame(const ProtocolFramePtr packet) { << connection_id << ", session_id: " << static_cast<int>(session_id) << ", message_id: " << message_id); - messageId_map[message_id] = {packet, date_time::DateTime::getCurrentTime()}; + messageId_map[message_id] = {packet, date_time::getCurrentTime()}; return RESULT_OK; } @@ -279,7 +279,7 @@ RESULT_CODE MultiFrameBuilder::HandleConsecutiveFrame( LOG4CXX_INFO(logger_, "Assembled frame with payload size: " << assembling_frame->payload_size()); - frame_data.append_time = date_time::DateTime::getCurrentTime(); + frame_data.append_time = date_time::getCurrentTime(); return RESULT_OK; } diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 872a8dc755..b4b66f47be 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -835,7 +835,7 @@ void ProtocolHandlerImpl::SendHeartBeat(int32_t connection_id, void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message, bool final_message) { #ifdef TELEMETRY_MONITOR - const TimevalStruct start_time = date_time::DateTime::getCurrentTime(); + const date_time::TimeDuration start_time = date_time::getCurrentTime(); #endif // TELEMETRY_MONITOR LOG4CXX_AUTO_TRACE(logger_); if (!message) { @@ -980,7 +980,7 @@ void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) { it != protocol_frames.end(); ++it) { #ifdef TELEMETRY_MONITOR - const TimevalStruct start_time = date_time::DateTime::getCurrentTime(); + const date_time::TimeDuration start_time = date_time::getCurrentTime(); #endif // TELEMETRY_MONITOR ProtocolFramePtr frame = *it; #ifdef ENABLE_SECURITY diff --git a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h index f42a0b4a15..9a91a5d1f7 100644 --- a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h +++ b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h @@ -35,6 +35,7 @@ #include "gmock/gmock.h" #include "protocol_handler/time_metric_observer.h" +#include "utils/shared_ptr.h" namespace test { namespace components { @@ -42,7 +43,8 @@ namespace protocol_handler_test { class MockPHTelemetryObserver : public ::protocol_handler::PHTelemetryObserver { public: - MOCK_METHOD2(StartMessageProcess, void(uint32_t, const TimevalStruct&)); + MOCK_METHOD2(StartMessageProcess, + void(uint32_t, const date_time::TimeDuration&)); MOCK_METHOD2(EndMessageProcess, void(std::shared_ptr<MessageMetric>)); }; |