|
@@ -66,15 +66,35 @@ int post_video_recordinfo_list(video_record_info_t* pinfo, int itimeout, bool bp
|
|
|
|
|
|
//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin http get request, timeout is %d, printdbg flag is %s.", req.m_timeOut, req.m_printDbg ? "true" : "false");
|
|
|
|
|
|
+ unsigned int ustarttime = get_millisec_time();
|
|
|
+
|
|
|
RecordInfoHTTPRet ret;
|
|
|
if (client->Post(req, ret)) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Post result is %s, returnCode:%s, code:%s, errorMsg:%s, message:%s.",
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("post result is %s, returnCode:%s, code:%s, errorMsg:%s, message:%s.",
|
|
|
ret.m_success ? "success" : "failed", ret.m_returnCode.c_str(), ret.m_code.c_str(), ret.m_errorMsg.c_str(), ret.m_message.c_str());
|
|
|
+ LogWarn(Severity_Low, Error_Debug, LOG_EVT_POST_RECORDINFO_COST_TIME, CSimpleStringA::Format("post video record infos cost time is %ums.", get_millisec_time()- ustarttime).GetData());
|
|
|
iret = 0;
|
|
|
}
|
|
|
else {
|
|
|
- LogWarn(Severity_Middle, Error_Exception, LOG_EVT_POST_RECORDINFO_FAILED, CSimpleStringA::Format("Post video record infos fail, url=%s, syscode=%d, usercode=%s, errmsg=%s", req.m_url.c_str(), ret.m_sysCode, ret.m_userCode.c_str(), ret.m_errMsg.c_str()).GetData());
|
|
|
+ LogWarn(Severity_Middle, Error_Exception, LOG_EVT_POST_RECORDINFO_FAILED, CSimpleStringA::Format("post video record infos fail, url=%s, syscode=%d, usercode=%s, errmsg=%s", req.m_url.c_str(), ret.m_sysCode, ret.m_userCode.c_str(), ret.m_errMsg.c_str()).GetData());
|
|
|
}
|
|
|
|
|
|
return iret;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+unsigned int get_millisec_time()
|
|
|
+{
|
|
|
+#ifdef RVC_OS_LINUX
|
|
|
+ unsigned int uptime = 0;
|
|
|
+ struct timespec on;
|
|
|
+ if (clock_gettime(CLOCK_MONOTONIC, &on) == 0) {
|
|
|
+ uptime = on.tv_sec * 1000 + on.tv_nsec / 1000000;
|
|
|
+ }
|
|
|
+
|
|
|
+ return uptime;
|
|
|
+
|
|
|
+# else
|
|
|
+ return GetTickCount();
|
|
|
+#endif
|
|
|
}
|