* Graph in */ $graphInScreen = new CScreenBase(array('resourcetype' => SCREEN_RESOURCE_GRAPH, 'mode' => SCREEN_MODE_PREVIEW, 'dataId' => 'graph_in', 'profileIdx' => 'web.httptest', 'profileIdx2' => get_request('httptestid'), 'period' => get_request('period'), 'stime' => get_request('stime'))); $graphInScreen->timeline['starttime'] = date(TIMESTAMP_FORMAT, get_min_itemclock_by_itemid($itemIds)); $src = 'chart3.php?height=150' . '&name=' . $httpTest['name'] . '&http_item_type=' . HTTPSTEP_ITEM_TYPE_IN . '&httptestid=' . $httpTest['httptestid'] . '&graphtype=' . GRAPH_TYPE_STACKED . '&period=' . $graphInScreen->timeline['period'] . '&stime=' . $graphInScreen->timeline['stime'] . '&profileIdx=' . $graphInScreen->profileIdx . '&profileIdx2=' . $graphInScreen->profileIdx2; $graphInContainer = new CDiv(new CLink(null, $src), 'flickerfreescreen', 'flickerfreescreen_graph_in'); $graphInContainer->setAttribute('style', 'position: relative'); $graphInContainer->setAttribute('data-timestamp', time()); $graphTable->addRow(array(bold(_('Speed')), $graphInContainer)); $timeControlData = array('id' => 'graph_in', 'containerid' => 'flickerfreescreen_graph_in', 'src' => $src, 'objDims' => $graphDims, 'loadSBox' => 1, 'loadImage' => 1, 'periodFixed' => CProfile::get('web.httptest.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD); zbx_add_post_js('timeControl.addObject("graph_in", ' . zbx_jsvalue($graphInScreen->timeline) . ', ' . zbx_jsvalue($timeControlData) . ');'); $graphInScreen->insertFlickerfreeJs(); /* * Graph time */ $graphTimeScreen = new CScreenBase(array('resourcetype' => SCREEN_RESOURCE_GRAPH, 'mode' => SCREEN_MODE_PREVIEW, 'dataId' => 'graph_time', 'profileIdx' => 'web.httptest', 'profileIdx2' => get_request('httptestid'), 'period' => get_request('period'), 'stime' => get_request('stime'))); $src = 'chart3.php?height=150' . '&name=' . $httpTest['name'] . '&http_item_type=' . HTTPSTEP_ITEM_TYPE_TIME . '&httptestid=' . $httpTest['httptestid'] . '&graphtype=' . GRAPH_TYPE_STACKED . '&period=' . $graphTimeScreen->timeline['period'] . '&stime=' . $graphTimeScreen->timeline['stime'] . '&profileIdx=' . $graphTimeScreen->profileIdx . '&profileIdx2=' . $graphTimeScreen->profileIdx2; $graphTimeContainer = new CDiv(new CLink(null, $src), 'flickerfreescreen', 'flickerfreescreen_graph_time'); $graphTimeContainer->setAttribute('style', 'position: relative'); $graphTimeContainer->setAttribute('data-timestamp', time()); $graphTable->addRow(array(bold(_('Response time')), $graphTimeContainer)); $timeControlData = array('id' => 'graph_time', 'containerid' => 'flickerfreescreen_graph_time', 'src' => $src, 'objDims' => $graphDims, 'loadSBox' => 1, 'loadImage' => 1, 'periodFixed' => CProfile::get('web.httptest.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD); zbx_add_post_js('timeControl.addObject("graph_time", ' . zbx_jsvalue($graphInScreen->timeline) . ', ' . zbx_jsvalue($timeControlData) . ');'); $graphTimeScreen->insertFlickerfreeJs(); // scroll CScreenBuilder::insertScreenScrollJs(array('timeline' => $graphInScreen->timeline)); CScreenBuilder::insertScreenRefreshTimeJs(); CScreenBuilder::insertProcessObjectsJs(); $graphsWidget->addItem($graphTable); $graphsWidget->show(); require_once dirname(__FILE__) . '/include/page_footer.php';
// dims $graph_dims = getGraphDims(); $graph_dims['width'] = -50; $graph_dims['graphHeight'] = 150; /* * Graph in */ $graph_in = new CScreenBase(['resourcetype' => SCREEN_RESOURCE_GRAPH, 'mode' => SCREEN_MODE_PREVIEW, 'dataId' => 'graph_in', 'profileIdx' => 'web.httptest', 'profileIdx2' => getRequest('httptestid'), 'period' => getRequest('period'), 'stime' => getRequest('stime')]); $httptest_manager = new CHttpTestManager(); $itemids = $httptest_manager->getHttpStepItems($httptest['httptestid']); $itemids = zbx_objectValues($itemids, 'itemid'); $graph_in->timeline['starttime'] = date(TIMESTAMP_FORMAT, get_min_itemclock_by_itemid($itemids)); $src = 'chart3.php?height=150' . '&name=' . $http_test_name . ': ' . _('Speed') . '&http_item_type=' . HTTPSTEP_ITEM_TYPE_IN . '&httptestid=' . $httptest['httptestid'] . '&graphtype=' . GRAPH_TYPE_STACKED . '&period=' . $graph_in->timeline['period'] . '&stime=' . $graph_in->timeline['stime'] . '&profileIdx=' . $graph_in->profileIdx . '&profileIdx2=' . $graph_in->profileIdx2; $graphs[] = (new CDiv(new CLink(null, $src)))->addClass('flickerfreescreen')->setId('flickerfreescreen_graph_in')->setAttribute('data-timestamp', time()); $time_control_data = ['id' => 'graph_in', 'containerid' => 'flickerfreescreen_graph_in', 'src' => $src, 'objDims' => $graph_dims, 'loadSBox' => 1, 'loadImage' => 1, 'periodFixed' => CProfile::get('web.httptest.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD]; zbx_add_post_js('timeControl.addObject("graph_in", ' . zbx_jsvalue($graph_in->timeline) . ', ' . zbx_jsvalue($time_control_data) . ');'); $graph_in->insertFlickerfreeJs(); /* * Graph time */ $graph_time = new CScreenBase(['resourcetype' => SCREEN_RESOURCE_GRAPH, 'mode' => SCREEN_MODE_PREVIEW, 'dataId' => 'graph_time', 'profileIdx' => 'web.httptest', 'profileIdx2' => getRequest('httptestid'), 'period' => getRequest('period'), 'stime' => getRequest('stime')]); $src = 'chart3.php?height=150' . '&name=' . $http_test_name . ': ' . _('Response time') . '&http_item_type=' . HTTPSTEP_ITEM_TYPE_TIME . '&httptestid=' . $httptest['httptestid'] . '&graphtype=' . GRAPH_TYPE_STACKED . '&period=' . $graph_time->timeline['period'] . '&stime=' . $graph_time->timeline['stime'] . '&profileIdx=' . $graph_time->profileIdx . '&profileIdx2=' . $graph_time->profileIdx2; $graphs[] = (new CDiv(new CLink(null, $src)))->addClass('flickerfreescreen')->setId('flickerfreescreen_graph_time')->setAttribute('data-timestamp', time()); $time_control_data = ['id' => 'graph_time', 'containerid' => 'flickerfreescreen_graph_time', 'src' => $src, 'objDims' => $graph_dims, 'loadSBox' => 1, 'loadImage' => 1, 'periodFixed' => CProfile::get('web.httptest.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD]; zbx_add_post_js('timeControl.addObject("graph_time", ' . zbx_jsvalue($graph_in->timeline) . ', ' . zbx_jsvalue($time_control_data) . ');'); $graph_time->insertFlickerfreeJs(); // scroll CScreenBuilder::insertScreenStandardJs(['timeline' => $graph_in->timeline]); // Create graphs widget. (new CWidget())->addItem((new CFilter('web.httpdetails.filter.state'))->addNavigator())->addItem((new CDiv($graphs))->addClass(ZBX_STYLE_TABLE_FORMS_CONTAINER))->show(); require_once dirname(__FILE__) . '/include/page_footer.php';