添加监控
This commit is contained in:
parent
18133846b6
commit
fe005a6c44
@ -135,12 +135,22 @@ namespace f8
|
||||
switch (node->method) {
|
||||
case 1:
|
||||
{
|
||||
long long begin_tick = a8::XGetTickCount();
|
||||
ret = a8::http::Get(finally_url, response, &node->headers, 10);
|
||||
long long end_tick = a8::XGetTickCount();
|
||||
if (end_tick - begin_tick > f8::HttpClientPool::Instance()->max_request_delay) {
|
||||
f8::HttpClientPool::Instance()->max_request_delay = end_tick - begin_tick;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
long long begin_tick = a8::XGetTickCount();
|
||||
ret = a8::http::Post(finally_url.c_str(), node->content, response, &node->headers, 10);
|
||||
long long end_tick = a8::XGetTickCount();
|
||||
if (end_tick - begin_tick > f8::HttpClientPool::Instance()->max_request_delay) {
|
||||
f8::HttpClientPool::Instance()->max_request_delay = end_tick - begin_tick;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -13,6 +13,9 @@ namespace f8
|
||||
HttpClientPool() {};
|
||||
friend class a8::Singleton<HttpClientPool>;
|
||||
|
||||
public:
|
||||
volatile long long max_request_delay = 0;
|
||||
|
||||
public:
|
||||
void Init(int thread_num);
|
||||
void UnInit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user