Пример #1
0
//流入百分比
$count = count($ports);
//端口数
$summaryData = array();
//汇总数据(MAX MIN AVG)
foreach ($ports as $pItem) {
    $result = array();
    $dayOne = array();
    $bandwidthOutOne = array();
    $bandwidthInOne = array();
    $percOutOne = array();
    $percInOne = array();
    $summaryDataOne = array();
    if ($type == 0) {
        //按天统计
        $result = RoomBussflow::getBandwithByDay($network, $mroom, $pItem['PORTS'], $start_date, $end_date, $accountType, $time_ids);
        $summaryDataResult = RoomBussflow::getSummaryDataByDay($network, $mroom, $pItem['PORTS'], $start_date, $end_date, $time_ids);
    }
    if ($type == 1) {
        //按小时统计
        $result = RoomBussflow::getBandwithByHours($network, $mroom, $pItem['PORTS'], $start_date, $end_date, $accountType, $time_ids);
        $summaryDataResult = RoomBussflow::getSummaryDataByHours($network, $mroom, $pItem['PORTS'], $start_date, $end_date, $time_ids);
    }
    if (!empty($result)) {
        foreach ($result as $rItem) {
            $dayOne[] = $rItem['UPDATE_TIME'];
            $bandwidthOutOne[] = $rItem['BANDWIDTH_OUT'];
            $bandwidthInOne[] = $rItem['BANDWIDTH_IN'];
            $percOutOne[] = floatval($rItem['PERC_OUT']);
            $percInOne[] = floatval($rItem['PERC_IN']);
        }
Пример #2
0
 $ports = RoomBussflow::getNdMroomPorts();
 //报表数据 -流量
 foreach ($ports as $pItem) {
     $network = $pItem['NETWORK_NAME'];
     $mroom = $pItem['MROOM'];
     $port = $pItem['PORTS'];
     $result = array();
     $dayOne = array();
     $bandwidthOutOne = array();
     $bandwidthInOne = array();
     $percOutOne = array();
     $percInOne = array();
     $summaryDataOne = array();
     if ($type == 0) {
         //按天统计
         $result = RoomBussflow::getBandwithByDay($network, $mroom, $port, $start_date, $end_date, $accountType);
         $summaryDataResult = RoomBussflow::getSummaryDataByDay($network, $mroom, $pItem['PORTS'], $start_date, $end_date);
     }
     if ($type == 1) {
         //按小时统计
         $result = RoomBussflow::getBandwithByHours($network, $mroom, $port, $start_date, $end_date, $accountType);
         $summaryDataResult = RoomBussflow::getSummaryDataByHours($network, $mroom, $pItem['PORTS'], $start_date, $end_date);
     }
     foreach ($result as $rItem) {
         $dayOne[] = $rItem['UPDATE_TIME'];
         $bandwidthOutOne[] = $rItem['BANDWIDTH_OUT'];
         $bandwidthInOne[] = $rItem['BANDWIDTH_IN'];
         $percOutOne[] = floatval($rItem['PERC_OUT']);
         $percInOne[] = floatval($rItem['PERC_IN']);
     }
     $day[] = $dayOne;