r104190 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104189‎ | r104190 | r104191 >
Date:19:55, 24 November 2011
Author:aaron
Status:ok
Tags:
Comment:
Added Database::getServerUptime() function to return seconds of uptime
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseMysql.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -2640,6 +2640,16 @@
26412641 }
26422642
26432643 /**
 2644+ * Determines how long the server has been up
 2645+ * STUB
 2646+ *
 2647+ * @return int
 2648+ */
 2649+ function getServerUptime() {
 2650+ return 0;
 2651+ }
 2652+
 2653+ /**
26442654 * Determines if the last failure was due to a deadlock
26452655 * STUB
26462656 *
Index: trunk/phase3/includes/db/DatabaseMysql.php
@@ -698,6 +698,16 @@
699699 }
700700
701701 /**
 702+ * Determines how long the server has been up
 703+ *
 704+ * @return int
 705+ */
 706+ function getServerUptime() {
 707+ $vars = $this->getMysqlStatus( 'Uptime' );
 708+ return (int)$vars['Uptime'];
 709+ }
 710+
 711+ /**
702712 * Determines if the last failure was due to a deadlock
703713 *
704714 * @return bool

Follow-up revisions

RevisionCommit summaryAuthorDate
r104191MFT r104190aaron19:56, 24 November 2011

Status & tagging log