La Paste
Create new paste
Pastes Archive
2024-01-24 17:01:48
copy
raw
download
$direction = 'R'; $protoFilter = 11; $dateFrom = date("Y-m-d H:i:s", (time() - 3600)); $dateTo = curdatetime(); $filterOffset = $protoFilter + 1; //timestamp is at 0 $classifier = new OphanimClassifier(); $grapher = new OphanimGraph(); $baseStruct = $classifier->getBaseStruct(); $allTracksData = rcms_scandir($classifier::DATA_PATH, $direction . '_*'); $allTrackedIps = array(); $ipByteCount = array(); if (!empty($allTracksData)) { foreach ($allTracksData as $io => $eachFile) { $cleanIp = str_replace($direction . '_', '', $eachFile); $allTrackedIps[] = $cleanIp; } } if (!empty($allTrackedIps)) { foreach ($allTrackedIps as $idx => $eachIp) { $rawData = $grapher->getChartData($eachIp, $direction, $dateFrom, $dateTo); if (!empty($rawData)) { foreach ($rawData as $io => $each) { if (isset($each[$filterOffset])) { $byteCount = $each[$filterOffset]; if ($byteCount) { if (isset($ipByteCount[$eachIp])) { $ipByteCount[$eachIp] += $byteCount; } else { $ipByteCount[$eachIp] = $byteCount; } } } } } } } if (!empty($ipByteCount)) { arsort($ipByteCount); } debarr($ipByteCount);
↑