diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/zabbix_server/httppoller/httptest.c | 12 |
2 files changed, 13 insertions, 0 deletions
@@ -118,6 +118,7 @@ Changes for 1.5: Changes for 1.4.6: + - [ZBX-404] fixed update of item "Download speed for scenario '...'" (Sasha) - [ZBX-272] fixed default link to local interface in *BSD for net.if* items (Sasha) - [ZBX-386] fixed possible agent crash in processing of active checks (Sasha) - [ZBX-379] added error checking for accept on server side (Sasha) diff --git a/src/zabbix_server/httppoller/httptest.c b/src/zabbix_server/httppoller/httptest.c index 388f70ef..04bd5713 100644 --- a/src/zabbix_server/httppoller/httptest.c +++ b/src/zabbix_server/httppoller/httptest.c @@ -168,6 +168,10 @@ static void process_test_data(DB_HTTPTEST *httptest, S_ZBX_HTTPSTAT *stat) SET_UI64_RESULT(&value, stat->test_last_step); process_value(httptestitem.itemid,&value); break; + case ZBX_HTTPITEM_TYPE_SPEED: + SET_UI64_RESULT(&value, stat->speed_download); + process_value(httptestitem.itemid, &value); + break; default: break; } @@ -263,6 +267,8 @@ static void process_httptest(DB_HTTPTEST *httptest) int lastfailedstep; S_ZBX_HTTPSTAT stat; + double speed_download = 0; + int speed_download_num = 0; CURL *easyhandle = NULL; @@ -466,6 +472,11 @@ static void process_httptest(DB_HTTPTEST *httptest) err_str = strdup(curl_easy_strerror(err)); lastfailedstep = httpstep.no; } + else + { + speed_download += stat.speed_download; + speed_download_num++; + } } httptest->time+=stat.total_time; @@ -492,6 +503,7 @@ static void process_httptest(DB_HTTPTEST *httptest) stat.test_total_time = httptest->time; stat.test_last_step = lastfailedstep; + stat.speed_download = speed_download_num ? speed_download / speed_download_num : 0; process_test_data(httptest, &stat); |