Fork me on GitHub
Subscribe 5

Ticket #666 (fixed enhancement)

Removing database size and row count from admin_index

  • Created: 2012-05-07 11:18:38
  • Reported by: Pierre
  • Assigned to: Studio384
  • Milestone: 1.5.1
  • Component: performance
  • Priority: low

The admin index show the number of rows and the database size. Unfortunately collecting this data is quite expensive; especially on bigger boards using innodb. (Can take several seconds and it seems non-cachable)

As this information is not that useful I'd suggest removing this feature. (or cache it locally with a high ttl)

History

Franz 2012-05-07 12:06:32

  • Milestone set to 1.5.1.

Something will be done about this, I think.

Studio384 2012-05-07 14:48:42

Mmm... I find this a nice part of FluxBB, please, keep it. Better make an option so people can chose if they want it there or not.

Pierre 2012-05-07 15:02:59

It is not that urgent to spend a lot of time on. ATM this page loads about 2 seconds here (depending on server load).

Maybe another solution is to just move the whole statistics part to its own menu entry. Then we can also add some more useful numbers like number of posts, topics, members, admins, unverified members etc.

Studio384 2012-05-07 16:11:50

@Pierre: Nice idea!

But then, there is something else: the index is than just to... blank?

Comment edited 1 times (Diff)

Oldskool 2012-05-14 10:05:54

I like Pierre's suggestion, that way you know what you're getting yourself into when clicking that link smile

The home page could then show a "general" message like "Welcome to the admin panel, use the buttons on the left to navigate to the page you want to view." and perhaps a small summary of what the pages contain.

Comment edited 1 times (Diff)

Franz 2012-05-14 10:46:34

I agree, too. Willing to do it, Jan? smile

Oldskool 2012-05-14 15:45:11

  • Owner set to Oldskool.

Sure thing, no problem!

Studio384 2012-05-14 16:10:50

So, we can see a new Stats-button on the admin panel in v1.5.1?

Oldskool 2012-05-14 20:28:57

Studio384 wrote:

So, we can see a new Stats-button on the admin panel in v1.5.1?

Yes, that's the idea.

Studio384 2012-05-14 20:32:09

Nice wink

Franz 2012-08-02 09:37:21

For 2.0, we can simply cache these values with a one-day TTL (easy to do with Laravel). That's a good compromise, too, in my eyes.

Studio384 2012-08-02 12:13:18

Mmm, I like more the idea of a statistics page, I miss a clear overview of my FluxBB installation.

Comment edited 2 times (Diff, Diff 2)

Studio384 2012-09-11 14:28:43

If those statics will disapear, it's maybe a good idea to display what's the newest version of FluxBB below "FluxBB Version". So you also got "Newest FluxBB version:" with behind that "x.x.x".

Comment edited 2 times (Diff, Diff 2)

Studio384 2012-09-12 20:06:47

  • Owner changed from Oldskool to Studio384.

I'll teak over from here.

But first a few questions:
Just remove this thing, or also add a statistics page? If it's the second: only for Admins or also for Moderators?

Comment edited 1 times (Diff)

Franz 2012-09-12 21:17:58

The information has to stay, but on a separate page, I think (no extra link in the admin menu, please - just a simple one on the admin index page).

I don't really think we need a lot of extra information...

Franz 2012-09-13 09:00:41

Wonderful. smile

Studio384 2012-09-13 14:39:27

Commit b6f1602 to fluxbb master

#666: Removing database size and row count from admin_index.php and create admin_statistics.php

Studio384 2012-09-13 16:13:26

Commit ffeec32 to fluxbb master

#666: Merge admin_index and admin_statistics

Franz 2012-09-13 21:35:34

Commit e6d6f68 to fluxbb master

Merge pull request #52 from Studio384/master

#666: Removing database size and row count from admin_index.php and create admin_statistics.php

Franz 2012-09-13 21:44:30

Commit 9d96abb to fluxbb master

#666: Fix included language file in admin_statistics.php.

Studio384 2012-09-14 05:08:06

  • Status changed from open to fixed.

quy 2012-09-22 19:46:52

$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Statistics']);

There isn't a language string for $lang_admin_common['Statistics'].

Since there isn't a "Statistics" menu and it is related to the Admin index page, should this:

generate_admin_menu('statistics');

be:

generate_admin_menu('index');

Franz 2012-09-22 19:48:44

Good catch. Would you mind fixing this, Quy?

quy 2012-09-24 02:59:41

Commit 710027d to fluxbb master

#666: Added/changed language strings. Fixed link to phpinfo.

quy 2012-09-24 03:08:46

  • Status changed from fixed to open.

Studio384: Please advise what you plan to do with the following in admin_statistics.php. Thanks.

// Collect some statistics from the database
if (file_exists(FORUM_CACHE_DIR.'cache_users_info.php'))
	include FORUM_CACHE_DIR.'cache_users_info.php';

if (!defined('PUN_USERS_INFO_LOADED'))
{
	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
		require PUN_ROOT.'include/cache.php';

	generate_users_info_cache();
	require FORUM_CACHE_DIR.'cache_users_info.php';
}

$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $db->error());
list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);

if ($pun_user['g_view_users'] == '1')
	$stats['newest_user'] = '<a href="profile.php?id='.$stats['last_user']['id'].'">'.pun_htmlspecialchars($stats['last_user']['username']).'</a>';
else
	$stats['newest_user'] = pun_htmlspecialchars($stats['last_user']['username']);

if (!empty($forum_actions))
{

?>
<div class="linksb">
	<div class="inbox crumbsplus">
		<p class="subscribelink clearb"><?php echo implode(' - ', $forum_actions); ?></p>
	</div>
</div>
<?php

}

Studio384 2012-09-24 18:29:29

Ow, that code is there 'cause that page is based on a plugin I was working on, so, I've forgot to remove that part.

quy 2012-09-24 22:08:05

Commit 8f68cfc to fluxbb master

#666: Removed extraneous code

quy 2012-09-24 22:10:31

  • Status changed from open to fixed.

OK. Thanks.