Part of the EllisLab Network
   
1 of 3
1
FireStick 1.1 (Performance logging add-on library)
Posted: 22 September 2008 10:26 AM   [ Ignore ]  
Summer Student
Total Posts:  9
Joined  07-29-2008

FireStick is a (relatively) simple to configure library that enables easy and low-overhead performance logging in CodeIgniter.

Performance measuring and logging is an important part of application maintenance and improvement.  FireStick makes it easy to record page render times, MySQL call times, and other related information that you can use to track down performance issues.

FireStick relies on CodeIgniter’s built-in performance and benchmarking capabilities and a post-system hook.  When the hook is called, FireStick logs all this information to the database for review at a later date.

Logs are split up into multiple tables based on date, with each new day’s table created automatically on the first request of each new day.  All logs are added using INSERT DELAYED so as to minimize impact on the database server.

Changes since version 1.0:

* Added columns to log table to track amount of time spent in actual application code vs. CI code.

Main project page: http://code.google.com/p/firestick/
Project source: http://firestick.googlecode.com/files/firestick-1.1.zip
Installation instructions: http://code.google.com/p/firestick/wiki/Installation

Questions?  Comments?  Leave ‘em below!

[EDIT: Added better description.]

[EDIT: New release - 1.1!]

Profile
 
 
Posted: 22 September 2008 12:12 PM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  53
Joined  03-18-2007

Can u explain in details what this source do ?

Profile
 
 
Posted: 22 September 2008 12:51 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  762
Joined  03-20-2006

Yeah you definitely need to explain a bit more about what it does and how it does it. Looks interesting though!

Profile
 
 
Posted: 22 September 2008 12:57 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  9
Joined  07-29-2008

Sure, I’ve updated the OP with a more complete explanation of what the library does.  Let me know if that’s still not clear enough.

Profile
 
 
Posted: 22 September 2008 01:07 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  762
Joined  03-20-2006

Ah i see, sounds good. Do you think it would have much impact on the speed of ci’s normal running ( i appreciate the delayed inserts part but there are obviously extra files being loaded ). I have logging turned off on live sites as i think it adds some noticeable overhead myself. I could be paranoid of course and it makes no difference of course!

Is it easy to turn on and off?

Profile
 
 
Posted: 22 September 2008 01:23 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  9
Joined  07-29-2008

It’s actually rather simple to turn off - edit config/firestick.php and set $config[‘log_frequency’] to 0 and no more logging.  Although, a rather more reasonable approach would be to set it to 1, meaning only 1% of all pages get logged.  With enough users, this should still be a large enough sample size to be able to identify performance issues in your application.

With that said, I don’t think FireStick has a noticable impact on CodeIgniter - I enabled it on an app I have running, and the render time difference was so small as to be within the margin for error, effectively negligable.

I consider performance monitoring and logging to simply be part of the total cost of running an application - if your app isn’t tell you where it’s slow, how are you ever going to know?

Profile
 
 
Posted: 22 September 2008 01:41 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  762
Joined  03-20-2006

I totally agree with you on performance monitoring on that front. Very important indeed. Usually i try to load test mine before it goes live but nothing beats real world testing.

I’ll give it a go tomorrow.

Profile
 
 
Posted: 28 September 2008 07:41 PM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  9
Joined  07-29-2008

New release!  Firestick now has a snazzy new logo and can keep track of the amount of time spent in actual application code vs. CodeIgniter code.

Profile
 
 
Posted: 29 September 2008 02:22 AM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  762
Joined  03-20-2006

Okay, i’ve finally got round to trying this out.

There seems to be a problem:

Severity: Notice—> Undefined index: HTTP_REFERER /var/www/vhosts/site.com/system/application/libraries/Firestick.php 157

Profile
 
 
Posted: 29 September 2008 02:31 AM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  762
Joined  03-20-2006

Whoops, didn’t mean to put my actual URL in there!

Profile
 
 
Posted: 29 September 2008 02:43 AM   [ Ignore ]   [ # 10 ]  
Summer Student
Avatar
Total Posts:  15
Joined  07-18-2007

Use CI library class: user_agent or the input class:

$this->CI->load->library(‘user_agent’);

$this->CI->agent->referrer();
$this->CI->agent->agent_string();

$this->CI->input->server();
$this->CI->input->ip_address();

for example…

Profile
 
 
   
1 of 3
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 10:15 AM
Total Registered Members: 119433 Total Logged-in Users: 61
Total Topics: 125687 Total Anonymous Users: 4
Total Replies: 661460 Total Guests: 508
Total Posts: 787147    
Members ( View Memberlist )