I like to show the forum load time at the end of forum, How to make it?
Oct 30, 2002, 11:51 AM
Staff / Moderator (2198 posts)
Oct 30, 2002, 11:51 AM
Post #2 of 26
Views: 11449
Hi backdream,
You'll need to install the Time::HiRes module in order to do this - otherwise the best you can get is whole seconds - and even if you see "1 second" it could be anywhere from 0.00001 seconds to 1.999999 seconds. Hence, doing this without Time::HiRes is almost pointless.
You'll need to make the changes in gforum.cgi (I've done this from time to time for development/optimization purposes). Basically, add this line immediately after all the "use" statements in the file:
Then add this line immediately after "sub main {":
After that, you're going to have to add a global - called "time_elapsed", perhaps. Its contents will be:
Then, wherever you want to display the time, just put:
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
You'll need to install the Time::HiRes module in order to do this - otherwise the best you can get is whole seconds - and even if you see "1 second" it could be anywhere from 0.00001 seconds to 1.999999 seconds. Hence, doing this without Time::HiRes is almost pointless.
You'll need to make the changes in gforum.cgi (I've done this from time to time for development/optimization purposes). Basically, add this line immediately after all the "use" statements in the file:
Code:
use Time::HiRes;Then add this line immediately after "sub main {":
Code:
$GForum::Start::Time = Time::HiRes::time();After that, you're going to have to add a global - called "time_elapsed", perhaps. Its contents will be:
Code:
sub { $GForum::Start::Time - Time::HiRes::time() }Then, wherever you want to display the time, just put:
Code:
Time to load: <%time_elapsed%> sJason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Oct 30, 2002, 11:56 PM
Veteran / Moderator (2199 posts)
Oct 30, 2002, 11:56 PM
Post #5 of 26
Views: 11468
I am getting times of about 0.05 seconds, and the hardware specs are about the same as yours. OS is Linux, though.
Ivan
-----
Iyengar Yoga Resources / GT Plugins
Ivan
-----
Iyengar Yoga Resources / GT Plugins
Oct 31, 2002, 9:20 AM
Administrator (9387 posts)
Oct 31, 2002, 9:20 AM
Post #6 of 26
Views: 11475
4s under modperl?! Your server must be heavily overloaded by other things, there is no way it should take that long. On a forum this size on a win2k, amd700, 512 megs of ram, and using MSSQL 2000, it averages 0.25s per page.
Cheers,
Alex
--
Gossamer Threads Inc.
Cheers,
Alex
--
Gossamer Threads Inc.
Oct 31, 2002, 4:01 PM
Administrator (9387 posts)
Oct 31, 2002, 4:01 PM
Post #8 of 26
Views: 11450
Hi,
Are you sure it's running under mod_perl? Add a global:
sub { $ENV{GATEWAY_INTERFACE} }
and tell me what it says?
Cheers,
Alex
--
Gossamer Threads Inc.
Are you sure it's running under mod_perl? Add a global:
sub { $ENV{GATEWAY_INTERFACE} }
and tell me what it says?
Cheers,
Alex
--
Gossamer Threads Inc.
Nov 3, 2002, 4:04 PM
User (117 posts)
Nov 3, 2002, 4:04 PM
Post #9 of 26
Views: 11422
It shows "CGI/1.1". It seems the mod_perl not worked...But the apache load ,it shows:
. . . . . . . . . . .
All modules loaded ok!
Compiling all functions ... All modules compiled and loaded ok!
I am attaching the httpd.conf, and startup.pl, Please notice me what's wrong!
My perl install in d:\perl, Apache install in d:\apache, My Gforum install in d:\sxforum.
Code:
Preloading Gossamer Forum modules into mod_perl: . . . . . . . . . . .
All modules loaded ok!
Compiling all functions ... All modules compiled and loaded ok!
I am attaching the httpd.conf, and startup.pl, Please notice me what's wrong!
My perl install in d:\perl, Apache install in d:\apache, My Gforum install in d:\sxforum.
Nov 4, 2002, 3:49 PM
User (117 posts)
Nov 4, 2002, 3:49 PM
Post #13 of 26
Views: 11437
Do you means set a alias? I move it to d:\images,and make a alias below:
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>But it cannot show images the same.
Code:
Alias /images/ "D:/images/"<Directory "D:/images"> Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Nov 5, 2002, 4:58 PM
Staff / Moderator (2198 posts)
Nov 5, 2002, 4:58 PM
Post #15 of 26
Views: 11397
Hi backdream,
You're going to need to change the image_url and image_path in GForum in order for it to recognize the new path. The image_url is easy - just change the variable.
As for setting the image_path, take a look at this post:
http://www.gossamer-threads.com/...i?post=221461#221461
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
You're going to need to change the image_url and image_path in GForum in order for it to recognize the new path. The image_url is easy - just change the variable.
As for setting the image_path, take a look at this post:
http://www.gossamer-threads.com/...i?post=221461#221461
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Apr 2, 2003, 12:20 PM
User (106 posts)
Apr 2, 2003, 12:20 PM
Post #16 of 26
Views: 11284
If you are going to leave the Time to Load message there all the time, you might use this sub for the global variable time_elapsed
sub { sprintf("%.2f", Time::HiRes::time() - $GForum::Start::Time) }
----------
Michael J. Challis - CRUZN8R - PT Cruiser Club - http://www.ptcruiserclub.org
http://www.ptcruiserclub.org/forum
sub { sprintf("%.2f", Time::HiRes::time() - $GForum::Start::Time) }

----------
Michael J. Challis - CRUZN8R - PT Cruiser Club - http://www.ptcruiserclub.org
http://www.ptcruiserclub.org/forum
Apr 2, 2003, 8:55 PM
User (422 posts)
Apr 2, 2003, 8:55 PM
Post #17 of 26
Views: 11334
Hi Jason,
I put the variable <%time_elapsed%> in include_footer.html and also in include_header.html. I get around 0,40s in include_header.html and around 1.50s in include_footer.html for the same page. Is it normal that I get two different times in the same page? If so, it meens that the place where we put the variable in the template changes his output.
Thank you.
François
I put the variable <%time_elapsed%> in include_footer.html and also in include_header.html. I get around 0,40s in include_header.html and around 1.50s in include_footer.html for the same page. Is it normal that I get two different times in the same page? If so, it meens that the place where we put the variable in the template changes his output.

Thank you.
François
Apr 3, 2003, 11:14 AM
Staff / Moderator (2198 posts)
Apr 3, 2003, 11:14 AM
Post #19 of 26
Views: 11251
Various template calls and globals run throughout the page, so the difference you see is the amount of time to get through everything in the template. There is usually nothing intensive after include_footer.html, so that time is the usually the best one to go by.
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Apr 3, 2003, 11:27 AM
Veteran (1240 posts)
Apr 3, 2003, 11:27 AM
Post #20 of 26
Views: 11232
Hi:
I added this- thanks! I get a result like:
This Page Loaded In: 0.71395206451416 seconds
How can I trim this to 0.71... ?
dave
Big Cartoon DataBase
Big Comic Book DataBase
I added this- thanks! I get a result like:
This Page Loaded In: 0.71395206451416 seconds
How can I trim this to 0.71... ?
dave
Big Cartoon DataBase
Big Comic Book DataBase
Apr 3, 2003, 11:52 AM
Veteran (1240 posts)
Apr 3, 2003, 11:52 AM
Post #22 of 26
Views: 11283
Paul:
Thanks.... (I was not familiar with that command, so I did not know!)
dave
Big Cartoon DataBase
Big Comic Book DataBase
Thanks.... (I was not familiar with that command, so I did not know!)
dave
Big Cartoon DataBase
Big Comic Book DataBase
May 24, 2003, 7:44 AM
Veteran (1240 posts)
May 24, 2003, 7:44 AM
Post #24 of 26
Views: 11134
For some reason, with the upgrade to 1.20, I get an error with this now...
Cannot find subroutine &Time::HiRes::time...
dave
Big Cartoon DataBase
Big Comic Book DataBase
Cannot find subroutine &Time::HiRes::time...
dave
Big Cartoon DataBase
Big Comic Book DataBase
May 24, 2003, 2:35 PM
Staff / Moderator (2198 posts)
May 24, 2003, 2:35 PM
Post #25 of 26
Views: 11169
See the second post in the thread - your gforum.cgi would have been overwritten in the upgrade, so you'll need to make those two small modifications again.
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com