fetchValue( 'SELECT UNIX_TIMESTAMP() - ' . $ServerStatusData->status['Uptime'] ); $retval = '

'; $bytes_received = $ServerStatusData->status['Bytes_received']; $bytes_sent = $ServerStatusData->status['Bytes_sent']; $retval .= sprintf( __('Network traffic since startup: %s'), implode( ' ', PMA_Util::formatByteDown( $bytes_received + $bytes_sent, 3, 1 ) ) ); $retval .= '

'; $retval .= '

'; $retval .= sprintf( __('This MySQL server has been running for %1$s. It started up on %2$s.'), PMA_Util::timespanFormat($ServerStatusData->status['Uptime']), PMA_Util::localisedDate($start_time) ) . "\n"; $retval .= '

'; if ($GLOBALS['replication_info']['master']['status'] || $GLOBALS['replication_info']['slave']['status'] ) { $retval .= '

'; if ($GLOBALS['replication_info']['master']['status'] && $GLOBALS['replication_info']['slave']['status'] ) { $retval .= __( 'This MySQL server works as master and ' . 'slave in replication process.' ); } elseif ($GLOBALS['replication_info']['master']['status']) { $retval .= __( 'This MySQL server works as master ' . 'in replication process.' ); } elseif ($GLOBALS['replication_info']['slave']['status']) { $retval .= __( 'This MySQL server works as slave ' . 'in replication process.' ); } $retval .= '

'; } /* * if the server works as master or slave in replication process, * display useful information */ if ($GLOBALS['replication_info']['master']['status'] || $GLOBALS['replication_info']['slave']['status'] ) { $retval .= '
'; $retval .= '

'; $retval .= __('Replication status'); $retval .= '

'; foreach ($GLOBALS['replication_types'] as $type) { if (isset($GLOBALS['replication_info'][$type]['status']) && $GLOBALS['replication_info'][$type]['status'] ) { $retval .= PMA_getHtmlForReplicationStatusTable($type); } } } return $retval; } /** * Prints server state traffic information * * @param PMA_ServerStatusData $ServerStatusData Server status data * * @return string */ function PMA_getHtmlForServerStateTraffic($ServerStatusData) { $hour_factor = 3600 / $ServerStatusData->status['Uptime']; $retval = ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= '
'; $retval .= __('Traffic') . ' '; $retval .= PMA_Util::showHint( __( 'On a busy server, the byte counters may overrun, so those statistics ' . 'as reported by the MySQL server may be incorrect.' ) ); $retval .= 'ø ' . __('per hour') . '
' . __('Received') . ''; $retval .= implode( ' ', PMA_Util::formatByteDown( $ServerStatusData->status['Bytes_received'], 3, 1 ) ); $retval .= ''; $retval .= implode( ' ', PMA_Util::formatByteDown( $ServerStatusData->status['Bytes_received'] * $hour_factor, 3, 1 ) ); $retval .= '
' . __('Sent') . ''; $retval .= implode( ' ', PMA_Util::formatByteDown( $ServerStatusData->status['Bytes_sent'], 3, 1 ) ); $retval .= ''; $retval .= implode( ' ', PMA_Util::formatByteDown( $ServerStatusData->status['Bytes_sent'] * $hour_factor, 3, 1 ) ); $retval .= '
' . __('Total') . ''; $bytes_received = $ServerStatusData->status['Bytes_received']; $bytes_sent = $ServerStatusData->status['Bytes_sent']; $retval .= implode( ' ', PMA_Util::formatByteDown( $bytes_received + $bytes_sent, 3, 1 ) ); $retval .= ''; $bytes_received = $ServerStatusData->status['Bytes_received']; $bytes_sent = $ServerStatusData->status['Bytes_sent']; $retval .= implode( ' ', PMA_Util::formatByteDown( ($bytes_received + $bytes_sent) * $hour_factor, 3, 1 ) ); $retval .= '
'; return $retval; } /** * Prints server state connections information * * @param PMA_ServerStatusData $ServerStatusData Server status data * * @return string */ function PMA_getHtmlForServerStateConnections($ServerStatusData) { $hour_factor = 3600 / $ServerStatusData->status['Uptime']; $retval = ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= ''; $retval .= '
' . __('Connections') . 'ø ' . __('per hour') . '%
' . __('max. concurrent connections') . ''; $retval .= PMA_Util::formatNumber( $ServerStatusData->status['Max_used_connections'], 0 ); $retval .= '--- ---
' . __('Failed attempts') . ''; $retval .= PMA_Util::formatNumber( $ServerStatusData->status['Aborted_connects'], 4, 1, true ); $retval .= ''; $retval .= PMA_Util::formatNumber( $ServerStatusData->status['Aborted_connects'] * $hour_factor, 4, 2, true ); $retval .= ''; if ($ServerStatusData->status['Connections'] > 0) { $abortNum = $ServerStatusData->status['Aborted_connects']; $connectNum = $ServerStatusData->status['Connections']; $retval .= PMA_Util::formatNumber( $abortNum * 100 / $connectNum, 0, 2, true ); $retval .= '%'; } else { $retval .= '--- '; } $retval .= '
' . __('Aborted') . ''; $retval .= PMA_Util::formatNumber( $ServerStatusData->status['Aborted_clients'], 4, 1, true ); $retval .= ''; $retval .= PMA_Util::formatNumber( $ServerStatusData->status['Aborted_clients'] * $hour_factor, 4, 2, true ); $retval .= ''; if ($ServerStatusData->status['Connections'] > 0) { $abortNum = $ServerStatusData->status['Aborted_clients']; $connectNum = $ServerStatusData->status['Connections']; $retval .= PMA_Util::formatNumber( $abortNum * 100 / $connectNum, 0, 2, true ); $retval .= '%'; } else { $retval .= '--- '; } $retval .= '
' . __('Total') . ''; $retval .= PMA_Util::formatNumber( $ServerStatusData->status['Connections'], 4, 0 ); $retval .= ''; $retval .= PMA_Util::formatNumber( $ServerStatusData->status['Connections'] * $hour_factor, 4, 2 ); $retval .= ''; $retval .= PMA_Util::formatNumber(100, 0, 2); $retval .= '%
'; return $retval; } ?>