5 #ifndef __DDS__UIChannelInfo__ 6 #define __DDS__UIChannelInfo__ 19 #include <boost/property_tree/json_parser.hpp> 23 namespace commander_cmd
38 , m_startTime(
std::chrono::steady_clock::now())
59 m_startTime = std::chrono::steady_clock::now();
72 T* pThis =
static_cast<T*
>(
this);
73 std::string userMessage = pThis->getMessage(_cmd, _channel);
78 pUI->template pushMsg<protocol_api::cmdSIMPLE_MSG>(
82 std::chrono::steady_clock::time_point curTime = std::chrono::steady_clock::now();
89 std::chrono::duration_cast<std::chrono::milliseconds>(curTime - m_startTime).count()));
94 catch (std::bad_weak_ptr& e)
111 T* pThis =
static_cast<T*
>(
this);
112 std::string userMessage = pThis->getErrorMessage(_cmd, _channel);
117 pUI->template pushMsg<protocol_api::cmdSIMPLE_MSG>(
121 std::chrono::steady_clock::time_point curTime = std::chrono::steady_clock::now();
128 std::chrono::duration_cast<std::chrono::milliseconds>(curTime - m_startTime).count()));
133 catch (std::bad_weak_ptr& e)
142 void checkAllReceived()
148 T* pThis =
static_cast<T*
>(
this);
149 std::string userMessage = pThis->getAllReceivedMessage();
154 pUI->template pushMsg<protocol_api::cmdSIMPLE_MSG>(
159 pUI->template pushMsg<protocol_api::cmdSHUTDOWN>();
165 catch (std::bad_weak_ptr& e)
182 std::chrono::steady_clock::time_point m_startTime;
197 std::stringstream ss;
198 auto p = _channel.lock();
207 std::stringstream ss;
208 auto p = _channel.lock();
215 std::stringstream ss;
236 std::stringstream ss;
237 auto p = _channel.lock();
239 float speed = (downloadTime != 0.) ? 0.001 * _cmd.
m_receivedFileSize / downloadTime : 0;
241 <<
" bytes in " << downloadTime <<
" s (" << speed <<
" KB/s)";
248 std::stringstream ss;
249 auto p = _channel.lock();
256 std::stringstream ss;
260 float downloadTime = 0.000001 * m_totalTime;
261 float speed = (downloadTime != 0.) ? 0.001 * m_totalReceived / downloadTime : 0;
262 ss <<
"download " << m_totalReceived <<
" bytes in " << downloadTime <<
" s (" << speed <<
" KB/s)";
282 std::stringstream ss;
283 auto p = _channel.lock();
292 std::stringstream ss;
293 auto p = _channel.lock();
300 std::stringstream ss;
319 std::string getAllReceivedMessage()
const;
322 bool isPluginOnline();
325 void checkPluginFailedToStart();
Definition: ProtocolCommands.h:52
std::string getMessage(const protocol_api::SBinaryAttachmentReceivedCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:233
std::string getErrorMessage(const protocol_api::SSimpleMsgCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:245
bool processMessage(const A &_cmd, CAgentChannel::weakConnectionPtr_t _channel)
Definition: UIChannelInfo.h:64
CGetLogChannelInfo()
Definition: UIChannelInfo.h:188
size_t nofReceived() const
Definition: UIChannelInfo.h:43
Definition: BinaryAttachmentReceivedCmd.h:15
size_t m_totalTime
Definition: UIChannelInfo.h:267
uint32_t m_receivedFileSize
Number of recieved bytes.
Definition: BinaryAttachmentReceivedCmd.h:26
std::string getErrorMessage(const protocol_api::SSimpleMsgCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:289
Definition: UIChannelInfo.h:185
bool m_shutdownOnComplete
Definition: UIChannelInfo.h:178
Definition: UIChannelInfo.h:222
size_t m_nofReceivedErrors
Definition: UIChannelInfo.h:174
std::string m_strInitialSubmitRequest
Definition: UIChannelInfo.h:331
std::string getAllReceivedMessage() const
Definition: UIChannelInfo.h:254
CAgentChannel::weakConnectionPtr_t m_channelSubmitPlugin
Definition: UIChannelInfo.h:330
std::mutex m_mutexStart
Definition: UIChannelInfo.h:176
std::weak_ptr< CAgentChannel > weakConnectionPtr_t
Definition: BaseChannelImpl.h:193
Definition: SimpleMsgCmd.h:16
std::string m_sMsg
Definition: SimpleMsgCmd.h:27
void zeroCounters()
Definition: UIChannelInfo.h:54
CUpdateTopologyChannelInfo()
Definition: UIChannelInfo.h:273
std::string m_requestedFileName
Requested name of the file.
Definition: BinaryAttachmentReceivedCmd.h:24
Definition: UIChannelInfo.h:270
size_t m_totalReceived
Definition: UIChannelInfo.h:266
Definition: dds-agent/src/AgentConnectionManager.h:16
std::string getMessage(const protocol_api::SBinaryAttachmentReceivedCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:194
CUIChannelInfo()
Definition: UIChannelInfo.h:30
std::chrono::system_clock::duration m_PluginStartTime
Definition: UIChannelInfo.h:332
std::string getMessage(const protocol_api::SSimpleMsgCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:279
Definition: UIChannelInfo.h:26
std::string getErrorMessage(const protocol_api::SSimpleMsgCmd &_cmd, CAgentChannel::weakConnectionPtr_t _channel) const
Definition: UIChannelInfo.h:204
CTestChannelInfo()
Definition: UIChannelInfo.h:225
Definition: ProtocolCommands.h:49
bool allReceived() const
Definition: UIChannelInfo.h:48
CAgentChannel::weakConnectionPtr_t m_channel
Definition: UIChannelInfo.h:175
Definition: CustomCmdCmd.h:14
uint32_t m_downloadTime
Time spent to download file [microseconds].
Definition: BinaryAttachmentReceivedCmd.h:27
Definition: ProtocolCommands.h:45
uint16_t m_srcCommand
Definition: UIChannelInfo.h:179
bool m_bInit
Definition: UIChannelInfo.h:333
std::string getAllReceivedMessage() const
Definition: UIChannelInfo.h:298
std::mutex m_mutexReceive
Definition: UIChannelInfo.h:177
size_t m_nofRequests
Definition: UIChannelInfo.h:172
std::string getAllReceivedMessage() const
Definition: UIChannelInfo.h:213
Definition: ProgressCmd.h:19
bool processErrorMessage(const A &_cmd, CAgentChannel::weakConnectionPtr_t _channel)
Definition: UIChannelInfo.h:103
size_t m_nofReceived
Definition: UIChannelInfo.h:173
Definition: UIChannelInfo.h:309