|
|
@ -50,11 +50,11 @@ foreach ($calendar->getNodes() as $day => $node) { |
|
|
|
$timeTo = strtotime('+1 day', 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))); |
|
|
|
|
|
|
|
|
|
|
|
$dbPeerTotalByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$dbPeerTotalByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$db, 'findPeerTotalByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
$db, 'findPeerTotalByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$dbPeerTotalByTimeAdded = $memory->getByMethodCallback( |
|
|
|
$dbPeerTotalByTimeAdded = $memory->getByMethodCallback( |
|
|
|
$db, 'findPeerTotalByTimeAdded', [$timeFrom, $timeTo] |
|
|
|
$db, 'findPeerTotalByTimeAdded', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Add daily stats |
|
|
|
// Add daily stats |
|
|
@ -68,11 +68,11 @@ foreach ($calendar->getNodes() as $day => $node) { |
|
|
|
$timeTo = strtotime(sprintf('%s-%s-%s %s:00', date('Y', $requestTime), date('n', $requestTime), $day, $hour + 1)); |
|
|
|
$timeTo = strtotime(sprintf('%s-%s-%s %s:00', date('Y', $requestTime), date('n', $requestTime), $day, $hour + 1)); |
|
|
|
|
|
|
|
|
|
|
|
$dbPeerTotalByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$dbPeerTotalByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$db, 'findPeerTotalByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
$db, 'findPeerTotalByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$dbPeerTotalByTimeAdded = $memory->getByMethodCallback( |
|
|
|
$dbPeerTotalByTimeAdded = $memory->getByMethodCallback( |
|
|
|
$db, 'findPeerTotalByTimeAdded', [$timeFrom, $timeTo] |
|
|
|
$db, 'findPeerTotalByTimeAdded', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$calendar->addNode($day, $dbPeerTotalByTimeUpdated, sprintf(_('%s:00-%s:00 online %s'), $hour, $hour + 1, $dbPeerTotalByTimeUpdated), 'green', 1); |
|
|
|
$calendar->addNode($day, $dbPeerTotalByTimeUpdated, sprintf(_('%s:00-%s:00 online %s'), $hour, $hour + 1, $dbPeerTotalByTimeUpdated), 'green', 1); |
|
|
@ -87,11 +87,11 @@ foreach ($calendar->getNodes() as $day => $node) { |
|
|
|
$timeTo = strtotime('+1 day', 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))); |
|
|
|
|
|
|
|
|
|
|
|
$dbPeerSessionSentSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$dbPeerSessionSentSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$db, 'findPeerSessionSentSumByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
$db, 'findPeerSessionSentSumByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$dbPeerSessionReceivedSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$dbPeerSessionReceivedSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$db, 'findPeerSessionReceivedSumByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
$db, 'findPeerSessionReceivedSumByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Add daily stats |
|
|
|
// Add daily stats |
|
|
@ -105,11 +105,11 @@ foreach ($calendar->getNodes() as $day => $node) { |
|
|
|
$timeTo = strtotime(sprintf('%s-%s-%s %s:00', date('Y', $requestTime), date('n', $requestTime), $day, $hour + 1)); |
|
|
|
$timeTo = strtotime(sprintf('%s-%s-%s %s:00', date('Y', $requestTime), date('n', $requestTime), $day, $hour + 1)); |
|
|
|
|
|
|
|
|
|
|
|
$dbPeerSessionSentSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$dbPeerSessionSentSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$db, 'findPeerSessionSentSumByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
$db, 'findPeerSessionSentSumByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$dbPeerSessionReceivedSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$dbPeerSessionReceivedSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
$db, 'findPeerSessionReceivedSumByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
$db, 'findPeerSessionReceivedSumByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$calendar->addNode($day, $dbPeerSessionSentSumByTimeUpdated, sprintf(_('%s:00-%s:00 ↑ %s'), $hour, $hour + 1, number_format($dbPeerSessionSentSumByTimeUpdated / 1000000, 3)), 'red', 1); |
|
|
|
$calendar->addNode($day, $dbPeerSessionSentSumByTimeUpdated, sprintf(_('%s:00-%s:00 ↑ %s'), $hour, $hour + 1, number_format($dbPeerSessionSentSumByTimeUpdated / 1000000, 3)), 'red', 1); |
|
|
|