|
|
|
@ -46,9 +46,9 @@ foreach ($calendar->getNodes() as $day => $node) {
@@ -46,9 +46,9 @@ foreach ($calendar->getNodes() as $day => $node) {
|
|
|
|
|
|
|
|
|
|
case 'peers': |
|
|
|
|
|
|
|
|
|
$timeThis = strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), $day)); |
|
|
|
|
$timeFrom = strtotime(sprintf('%s-%s-%s 00:00', date('Y', $requestTime), date('n', $requestTime), $day)); |
|
|
|
|
$timeTo = strtotime('+1 day', strtotime(sprintf('%s-%s-%s 00:00', date('Y', $requestTime), date('n', $requestTime), $day))); |
|
|
|
|
$timeThis = strtotime('+1 day', strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), $day))); |
|
|
|
|
|
|
|
|
|
$dbPeerTotalByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
|
$db, 'findPeerTotalByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $timeThis ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
@ -65,9 +65,9 @@ foreach ($calendar->getNodes() as $day => $node) {
@@ -65,9 +65,9 @@ foreach ($calendar->getNodes() as $day => $node) {
|
|
|
|
|
// Add hourly stats |
|
|
|
|
for ($hour = 0; $hour < 24; $hour++) { |
|
|
|
|
|
|
|
|
|
$timeThis = strtotime(sprintf('%s-%s-%s %s:00', date('Y'), date('n'), $day, $hour)); |
|
|
|
|
$timeFrom = strtotime(sprintf('%s-%s-%s %s:00', date('Y', $requestTime), date('n', $requestTime), $day, $hour)); |
|
|
|
|
$timeTo = strtotime(sprintf('%s-%s-%s %s:00', date('Y', $requestTime), date('n', $requestTime), $day, $hour + 1)); |
|
|
|
|
$timeThis = strtotime(sprintf('%s-%s-%s %s:00', date('Y'), date('n'), $day, $hour + 1)); |
|
|
|
|
|
|
|
|
|
$dbPeerTotalByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
|
$db, 'findPeerTotalByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $timeThis ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
@ -84,9 +84,9 @@ foreach ($calendar->getNodes() as $day => $node) {
@@ -84,9 +84,9 @@ foreach ($calendar->getNodes() as $day => $node) {
|
|
|
|
|
break; |
|
|
|
|
case 'traffic': |
|
|
|
|
|
|
|
|
|
$timeThis = strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), $day)); |
|
|
|
|
$timeFrom = strtotime(sprintf('%s-%s-%s 00:00', date('Y', $requestTime), date('n', $requestTime), $day)); |
|
|
|
|
$timeTo = strtotime('+1 day', strtotime(sprintf('%s-%s-%s 00:00', date('Y', $requestTime), date('n', $requestTime), $day))); |
|
|
|
|
$timeThis = strtotime('+1 day', strtotime(sprintf('%s-%s-%s 00:00', date('Y'), date('n'), $day))); |
|
|
|
|
|
|
|
|
|
$dbPeerSessionSentSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
|
$db, 'findPeerSessionSentSumByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $timeThis ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
@ -103,9 +103,9 @@ foreach ($calendar->getNodes() as $day => $node) {
@@ -103,9 +103,9 @@ foreach ($calendar->getNodes() as $day => $node) {
|
|
|
|
|
// Add hourly stats |
|
|
|
|
for ($hour = 0; $hour < 24; $hour++) { |
|
|
|
|
|
|
|
|
|
$timeThis = strtotime(sprintf('%s-%s-%s %s:00', date('Y'), date('n'), $day, $hour)); |
|
|
|
|
$timeFrom = strtotime(sprintf('%s-%s-%s %s:00', date('Y', $requestTime), date('n', $requestTime), $day, $hour)); |
|
|
|
|
$timeTo = strtotime(sprintf('%s-%s-%s %s:00', date('Y', $requestTime), date('n', $requestTime), $day, $hour + 1)); |
|
|
|
|
$timeThis = strtotime(sprintf('%s-%s-%s %s:00', date('Y'), date('n'), $day, $hour + 1)); |
|
|
|
|
|
|
|
|
|
$dbPeerSessionSentSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
|
$db, 'findPeerSessionSentSumByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $timeThis ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
|