|
|
|
@ -50,11 +50,11 @@ foreach ($calendar->getNodes() as $day => $node) {
@@ -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))); |
|
|
|
|
|
|
|
|
|
$dbPeerTotalByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
|
$db, 'findPeerTotalByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
|
$db, 'findPeerTotalByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$dbPeerTotalByTimeAdded = $memory->getByMethodCallback( |
|
|
|
|
$db, 'findPeerTotalByTimeAdded', [$timeFrom, $timeTo] |
|
|
|
|
$db, 'findPeerTotalByTimeAdded', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add daily stats |
|
|
|
@ -68,11 +68,11 @@ foreach ($calendar->getNodes() as $day => $node) {
@@ -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)); |
|
|
|
|
|
|
|
|
|
$dbPeerTotalByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
|
$db, 'findPeerTotalByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
|
$db, 'findPeerTotalByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$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); |
|
|
|
@ -87,11 +87,11 @@ foreach ($calendar->getNodes() as $day => $node) {
@@ -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))); |
|
|
|
|
|
|
|
|
|
$dbPeerSessionSentSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
|
$db, 'findPeerSessionSentSumByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
|
$db, 'findPeerSessionSentSumByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$dbPeerSessionReceivedSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
|
$db, 'findPeerSessionReceivedSumByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
|
$db, 'findPeerSessionReceivedSumByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add daily stats |
|
|
|
@ -105,11 +105,11 @@ foreach ($calendar->getNodes() as $day => $node) {
@@ -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)); |
|
|
|
|
|
|
|
|
|
$dbPeerSessionSentSumByTimeUpdated = $memory->getByMethodCallback( |
|
|
|
|
$db, 'findPeerSessionSentSumByTimeUpdated', [$timeFrom, $timeTo] |
|
|
|
|
$db, 'findPeerSessionSentSumByTimeUpdated', [$timeFrom, $timeTo], ($timeTo <= $requestTime ? 2592000 : MEMCACHED_TIMEOUT) + time() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$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); |
|
|
|
|