Skip to:
Content
Pages
Categories
Search
Top
Bottom

new performance testing plugin: Browser Timer


  • _ck_
    Participant

    @_ck_

    This is a very early beta release for advanced users who may find it useful.

    http://bbpress.org/plugins/topic/browser-timer/

    (works in 0.9 and 1.x)

    example log:

    http://bbpress.org/plugins/topic/browser-timer/screenshots/screenshot-1.png

    While my bb-benchmark plugin will tell you how long it’s taking your server to make pages, you really have no idea how long it’s taking your users to browse your forums and see those pages.

    ie. 200ms on the server side may be 5 seconds with javascript on the visitors side

    You can time your own browser, but often you have many things already cached and might use a faster browser or live much closer to your server than someone else across the country or the other side of the world.

    So now you can know exactly how long it’s taking for them to see your pages.

    It’s very accurate in my testing, within 100ms typically.

    Basically it works by using a sort of “round trip” timer.

    You can add a geo-location database and it will tell you what country the visitor is in, which helps to understand why a time may be so high/low.

Viewing 12 replies - 1 through 12 (of 12 total)

  • _ck_
    Participant

    @_ck_

    Once properly configured and running, administrators can get easy access to the log by just adding ?browsertimer to the forum url.

    The view right now is very basic and looks like this:

    http://bbpress.org/plugins/topic/browser-timer/screenshots/screenshot-1.png

    I’ve done some fancy parsing of the user-agent to attempt to strip it down to the useful bits. (in the example the IP addresses are partially obscured for visitor privacy)


    _ck_
    Participant

    @_ck_

    Currently there are only four settings and all but the first are optional.

    Edit the top of the plugin to see them:

    $browsertimer['log']='/browsertimer/browsertimer.log';

    That is where the log is kept.

    Obviously the directory must be chmod 777 on your server.

    For that reason I STRONGLY recommend you put it ABOVE the web root.

    The default setting will do that:

    dirname($_SERVER['DOCUMENT_ROOT']).'/browsertimer/browsertimer.log'

    but since it may confuse people, adjust it as you will.

    ie. /home/username/public_html/

    is the webroot on many servers but not all by any means

    you could in theory make

    /home/username/browsertimer/

    and chmod 777 that directory, and it will work with the default setting.

    $browsertimer['filter']=true;

    This setting just throws away entries longer than 20 seconds or less than 100ms which are typically bogus. For example Google has a nasty habit now of parsing javascript no matter how obfuscated it may be to extract URLs, and sure enough it will follow the browser timer, giving you really high, weird numbers.

    $browsertimer['pages']=false;

    This allows you to control what pages are timed.

    I’d leave it alone for now but someone may have specific interest in mind.

    $browsertimer['geoip']=false;

    This is where the geo-location magic happens, it’s optional, and will tell you what country the visitor is in with about 90% accuracy.

    false = country lookup off

    or set it to ='ip2c';

    and download this program called IP2C

    http://admin.firestats.cc/ccount/click.php?id=74

    extract these two files and put them in the same directory:

    ip2c.php
    ip-to-country.bin

    (ip-to-country.bin is very large, it’s one big database)


    pastorbobsforum
    Member

    @pastorbobsforum

    Hello.

    I have an account on limedomains.com

    My home directory is pastorbob.limewebs.com

    So, I figured that this should be my setting in browser-timer.php

    $browsertimer['log']=dirname($_SERVER['DOCUMENT_ROOT']).'/pastorbob.limewebs.com/my-plugins/browser-timer/browsertimer.log';

    I set the permission for browser-timer to 777.

    I created a file called browsertime.log

    But when I go to http://pastorbob.limewebs.com/?browsertimer , I get log open error

    Is it just me?

    Regards,

    Bob


    _ck_
    Participant

    @_ck_

    Ah, you almost have the log location concept but not quite.

    I am going to assume you are trying to put the log file in the same directory as the plugin. I really don’t advise this at all for security reasons but if you are just doing short term testing and will delete it later it could be temporarily acceptable.

    So, in that case my-plugins/browser-timer/ must be chmod 777

    (the sub-directory /browser-timer/ I mean)

    Now is the path to the file really

    /pastorbob.limewebs.com/my-plugins/browser-timer/browsertimer.log'

    Because that doesn’t seem quite right. I see it’s off a subdomain but still, I’ll not certain.

    Try changing

    dirname($_SERVER['DOCUMENT_ROOT'])

    to just plain

    $_SERVER['DOCUMENT_ROOT']

    (don’t forget leave the dot afterwards)

    If that doesn’t work, what’s the full path to my-plugins/browser-timer/ that you see in your FTP program (if it hopefully shows the full path). If not, we can take a peek at phpinfo.

    What I’d really rather see is you putting the log in a subdirectory ABOVE your web root (aka Document Root).

    But give that a try for now and let me know.


    _ck_
    Participant

    @_ck_

    By the way, your site is using 69 queries on the front page, that is VERY very bad. Something is wrong. It’s probably not loading all your options at once and some other issues that 1.0 has.

    You probably should be focusing on bb-benchmark instead of this plugin.

    Also make sure you install this mini-plugin to try to reduce the queries:

    http://bbpress.org/forums/topic/heres-how-to-fix-some-of-the-10-query-performance-regression


    pastorbobsforum
    Member

    @pastorbobsforum

    Hello again.

    I cannot get it to work yet. Jolly well!

    So, my Filezilla path is: /pastorbob.limewebs.com/my-plugins/browser-timer/

    But my FTP is ftp://ftp001101.limedomains.com/pastorbob.limewebs.com/my-plugins/browser-timer/

    I have changed this to what you’ve told me: $browsertimer['log']=$_SERVER['DOCUMENT_ROOT'].'/pastorbob.limewebs.com/my-plugins/browser-timer/browsertimer.log'

    Then I’ve tried the other option as well: $browsertimer['log']=$_SERVER['DOCUMENT_ROOT'].'/ftp001101.limedomains.com/pastorbob.limewebs.com/my-plugins/browser-timer/browsertimer.log'

    I thought that I might have been on to something. But I wasn’t.

    Thank you for your help, again!

    Regards,

    Bob


    _ck_
    Participant

    @_ck_

    Your server must have some fancy virtual host mapping.

    By the way I just noticed you said this “I created a file called browsertime.log”

    delete that file you made because it may have permissions that PHP cannot modify for some reason depending on your host – let the PHP code make the file

    Well we can take the lazy way out:

    $browsertimer['log']=dirname(__FILE__).'/browsertimer.log';

    That should almost certainly work and be right in the plugin directory.


    pastorbobsforum
    Member

    @pastorbobsforum

    I have deleted the .log file. I’ve made the modifications in browser-timer.php

    $browsertimer=dirname(__FILE__).'/browsertimer.log';

    The weird thing is that I can no longer see the .log file being created and I get the same log open error

    My permissions on the folder are 777, as I said before.

    Another thing is that I am getting a 550 Permission Denied in Filezilla when I try chmod, but it’s ok in their filemanager. Even Filezilla tells me that I have 777.

    Any other ideas?

    Bob


    _ck_
    Participant

    @_ck_

    Okay let’s assume the host is doing something weird.

    Make a temporary file in the same directory that you want the log to be.

    ie. test.php

    put this in the file

    <?php echo __FILE__; ?>

    Then access it from the web, ie. example.com/my-plugins/browser-timer/test.php

    Whatever it shows you, change the ending test.php part to browsertimer.log

    and then put it inside

    $browsertimer['log']='full line here';

    Now that has to work, as long as the my-plugins/browser-timer/ directory is chmod 777.


    _ck_
    Participant

    @_ck_

    Oh and it just dawned on me.

    If you have an empty log (ie. no visitors) you’ll always get an open log error.

    So be sure to load the front page as a test first.


    pastorbobsforum
    Member

    @pastorbobsforum

    Well, now this is…interesting.

    I uploaded the test.php

    After http://pastorbob.limewebs.com/my-plugins/browser-timer/test.php

    I get this: `Internal Server Error</p>

    <p>Directory “(removed for security)/pastorbob.limewebs.com/my-plugins/browser-timer” is writeable by group`

    Which had one good thing to it: it gave me my server directory.

    But anyhow, after that I tried again the http://pastorbob.limewebs.com/?browsertimer I discovered that is working, without the extra modification that you’ve suggested.

    Simply $browsertimer['log']=dirname(__FILE__).'/browsertimer.log'; and it worked.

    I obviously modified the line to $browsertimer['log']='(removed for security)/pastorbob.limewebs.com/my-plugins/browser-timer/browsertimer.log'; and it worked just as well.

    Now, my uneducated conclusion was that as long as I had one file called browsertimer.log in my entire forum folder the two expression would output the same result. The 2nd on the other hand is the best one.

    What would your conclusion be?

    Thank you anyway.

    Regards,

    Bob


    _ck_
    Participant

    @_ck_

    Ah, your server has some kind of security option that does not allow code to execute directly from chmod 777 directories.

    The first option would actually work better as far as not knowing the real directory or if you ever changed servers or directory names

    ie. $browsertimer['log']=dirname(__FILE__).'/browsertimer.log';

    Sorry this took so long to get going for you but don’t forget to work on why the queries are so high, that’s far more important.

Viewing 12 replies - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.