From 8ecabdb3d3c09c34e525ab217b67757e918dc2b0 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 9 Aug 2023 16:47:47 +0300 Subject: [PATCH] add peer.timeOnline registration --- database/yggstate.mwb | Bin 9426 -> 9507 bytes src/crontab/crawler.php | 6 +++ src/library/mysql.php | 94 ++++++++++++++++++++++++++++++++++------ 3 files changed, 87 insertions(+), 13 deletions(-) diff --git a/database/yggstate.mwb b/database/yggstate.mwb index 4acbca8618c39175349384b17ca1693d1f0e2c36..330f18f3a9f49fd1622c8df4f8aa7feb697a063b 100644 GIT binary patch literal 9507 zcmZ{q1x#Jfx9@RxcR08^#oe7kad&rjhvM#9plCT*@#4juQ``^k?)Lio{qu6)ySaCE zX3u2JTFK7N%xAJzzG{llFgOtZH2nxf?bRnsMEJk+e>%+H?%-^0&%wvT#l;Sx_OBxp z1OkNpUq^FHxDb8{2nc0EC5`p1r+7$Z9ldi{QNkW2K*6eAnfa zUKWQLz8xOUNgrrBrg`xPyjzmDx133alMs|Ul0b-!gw_b|LbMCOl%plvKe~TDOe}u! z5O}vV_IC?`eC@r7eYmk@kBtU|l@3%3v)N^b=qL34@tkz2ygDDfVSC9qRClXdHfSYJ zV}42zHP>BQ;4vKNt(eYWOzKZ(j0e+~mhgJ}J_PHP!a+dh z)`SkcMn*z#D>wNB$iR>JVRl%>wp!#9pIj0voy)6t`5Oet>l&Tb%?TG;ctmsucE3j7 zo|$t0c((-(ykAX=;(nOCPs^HmY;tFJQ!hUpKU_y9VQRi-TXKKAYOwwyYL2U`C8f=! zG0zUDxVZ;VCuy^f$p%*4gPq;o=aaNGqA1fk4?JAoadRhvnE!s3_Wf$E?VH|t|F4Di zgJ#^e!h}%4#RzHqQ}V)P>g~!5-ZF^aGUoG^TVEOb?6QV9+;A~}(5kV$kL-WQe zAR)SF0P`vJH)u32Jn!Qtdk>LkLnw?P+#gPJ9orN<<4SA208wr9$=_Wb$=_YQG44bP zV?5q6h)~NZ%3(ANhC$5nnH@B`k4Ku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P76Nn%Wgp%gc|Py)Vy?wmo+)VWX3;)a};Z&v5_mBf?W2e$eXU(Y>1O*}pm>P}?$+KOs~#ZAQuy5Dra20u^mjv55b&b)Tm zO1d8LUs&)EDTGE^bP!Kr8RMg|eaq`YMj&9A?xn)zjmHPA9fa-2Ao>=Uvvby)lw(ut z1Z-dH%)%#0?6Er>#%ADg6D%So3Ci;p+y$G;Wy!I;H!wx_}y#pyC-B8*XvEtv|^Lp z)G;Jcv5~rzX=H5X1Gq}M6J0A?rIDXO%btISE>0t?PN01QIhFb&Q_CJPEsAx27U3re zb&7>c7H|Oyt@)T`=(Y+qctXW7A#EV??}YYxpu(RGI5jyUxxEuGf#{YdLj{#i$Jncy znn!i;n_&kARs!z-Z|!+ol>ccVq5r0TMxXzg@&7aV{P%bOpegiiQU70-pZ_)c|3!fR z%2uTM-*}**{O+IK2mtqXRJ_fLv;crGK-E`EQ-w;`)!os;+Qrh2O4ZfM+KI~C-O|q9 i+nS1-gA2v^-yL=jOFL_4a}QxEUt3!bPjgRel>Y{G=p7UQ diff --git a/src/crontab/crawler.php b/src/crontab/crawler.php index f74f515..b61256b 100644 --- a/src/crontab/crawler.php +++ b/src/crontab/crawler.php @@ -121,6 +121,9 @@ if ($connectedPeers = Yggverse\Yggdrasilctl\Yggdrasil::getPeers()) { $db->updatePeerRemoteUptime($dbPeerRemote->peerRemoteId, $connectedPeerInfo->uptime, time()); } + $debug['yggdrasil']['peer']['remote']['total']['update'] += + $db->updatePeerRemoteTimeOnline($dbPeerRemote->peerRemoteId, time()); + } else { if ($peerRemoteId = $db->addPeerRemote($dbPeerId, @@ -133,6 +136,9 @@ if ($connectedPeers = Yggverse\Yggdrasilctl\Yggdrasil::getPeers()) { time())) { $debug['yggdrasil']['peer']['remote']['total']['insert']++; + + $debug['yggdrasil']['peer']['remote']['total']['update'] += + $db->updatePeerRemoteTimeOnline($peerRemoteId, time()); } } diff --git a/src/library/mysql.php b/src/library/mysql.php index 9979939..4049ba8 100644 --- a/src/library/mysql.php +++ b/src/library/mysql.php @@ -97,16 +97,17 @@ class MySQL { $this->_debug->query->insert->total++; - $query = $this->_db->prepare('INSERT INTO `peerRemote` SET `peerId` = ?, - `scheme` = ?, - `host` = ?, - `port` = ?, - `received` = ?, - `sent` = ?, - `uptime` = ?, - `timeAdded` = ?'); - - $query->execute([$peerId, $scheme, $host, $port, $received, $sent, $uptime, $timeAdded]); + $query = $this->_db->prepare('INSERT INTO `peerRemote` SET `peerId` = ?, + `scheme` = ?, + `host` = ?, + `port` = ?, + `received` = ?, + `sent` = ?, + `uptime` = ?, + `timeAdded` = ?, + `timeUpdated` = ?'); + + $query->execute([$peerId, $scheme, $host, $port, $received, $sent, $uptime, $timeAdded, $timeAdded]); return $this->_db->lastInsertId(); } @@ -144,6 +145,17 @@ class MySQL { return $query->rowCount(); } + public function updatePeerRemoteTimeOnline(int $peerRemoteId, $time) { + + $this->_debug->query->update->total++; + + $query = $this->_db->prepare('UPDATE `peerRemote` SET `timeOnline` = ?, `timeUpdated` = ? WHERE `peerRemoteId` = ? LIMIT 1'); + + $query->execute([$time, $time, $peerRemoteId]); + + return $query->rowCount(); + } + public function findPeerRemote(int $peerId, string $scheme, string $host, int $port) { $this->_debug->query->select->total++; @@ -162,9 +174,9 @@ class MySQL { $this->_debug->query->insert->total++; - $query = $this->_db->prepare('INSERT INTO `peerCoordinate` SET `peerId` = ?, - `port` = ?, - `timeAdded` = ?'); + $query = $this->_db->prepare('INSERT INTO `peerCoordinate` SET `peerId` = ?, + `port` = ?, + `timeAdded` = ?'); $query->execute([$peerId, $port, $timeAdded]); @@ -217,6 +229,62 @@ class MySQL { return $query->fetchAll(); } + // Analytics + public function getPeerFirst() { + + $this->_debug->query->select->total++; + + $query = $this->_db->prepare('SELECT * FROM `peer` ORDER BY `peerId` ASC LIMIT 1'); + + $query->execute(); + + return $query->fetch(); + } + + public function getPeerTotal() { + + $this->_debug->query->select->total++; + + $query = $this->_db->prepare('SELECT COUNT(*) AS `total` FROM `peer`'); + + $query->execute(); + + return $query->fetch()->total; + } + + public function findPeerTotalByTime(int $timeUpdatedFrom, int $timeUpdatedTo) : int { + + $this->_debug->query->select->total++; + + $query = $this->_db->prepare('SELECT COUNT(DISTINCT `peerId`) AS `total` FROM `peerRemote` WHERE (`timeAdded` > ? AND `timeAdded` < ?) OR (`timeUpdated` > ? AND `timeUpdated` < ?)'); + + $query->execute([$timeUpdatedFrom, $timeUpdatedTo, $timeUpdatedFrom, $timeUpdatedTo]); + + return (int) $query->fetch()->total; + } + + public function findPeerRemoteReceivedSumByTime(int $timeUpdatedFrom, int $timeUpdatedTo) : int { + + $this->_debug->query->select->total++; + + $query = $this->_db->prepare('SELECT SUM(`received`) AS `result` FROM `peerRemote` WHERE (`timeAdded` > ? AND `timeAdded` < ?) OR (`timeUpdated` > ? AND `timeUpdated` < ?)'); + + $query->execute([$timeUpdatedFrom, $timeUpdatedTo, $timeUpdatedFrom, $timeUpdatedTo]); + + return (int) $query->fetch()->result; + } + + public function findPeerRemoteSentSumByTime(int $timeUpdatedFrom, int $timeUpdatedTo) : int { + + $this->_debug->query->select->total++; + + $query = $this->_db->prepare('SELECT SUM(`sent`) AS `result` FROM `peerRemote` WHERE (`timeAdded` > ? AND `timeAdded` < ?) OR (`timeUpdated` > ? AND `timeUpdated` < ?)'); + + $query->execute([$timeUpdatedFrom, $timeUpdatedTo, $timeUpdatedFrom, $timeUpdatedTo]); + + return (int) $query->fetch()->result; + } + // Other public function optimize() {