Generating a Trample configuration file from a Rails server log

Below is a Rake Task to parse a Rails server log using Timber to generate a Trample configuration file for load testing.

Just download Timber from https://github.com/cainlevy/timber and copy it into your rails app's: /vender/plugins/cainlevy-timber

Then copy this task into: /lib/tasks

Then run with: rake trample:generate LOG=log/development.log"

(Don't forget to convert any filtered parameters like passwords from [FILTERED] to the actual value.)

Generating httperf wsesslog data from a Rails server log

Below is a Rake Task to parse a Rails server log using Timber to generate httperf wsesslog formatted data for load testing.

Just download Timber from https://github.com/cainlevy/timber and copy it into your rails app's: /vender/plugins/cainlevy-timber

Then copy this task into: /lib/tasks

Then run with: rake wsesslog:generate LOG=log/development.log"

(Don't forget to convert any filtered parameters like passwords from [FILTERED] to the actual value.)

 

Hmm, the iPad doesn't seem to handle overflow scrolling nicely...

Just tried to render a web page with overflow: scroll components for touch scrolling on an iPad.  Awful performance.  At least this seems to make it better:

http://mobile.tutsplus.com/tutorials/mobile-web-apps/ios-5-fixed-positioning-and-content-scrolling/

 

Here's a quick example, I wired up in Rails.

If you browse to the following links on an iPad, the scrolling performance is bad:

http://denniskuczynski.com/tests/mobile_tables/table_style

http://denniskuczynski.com/tests/mobile_tables/ul_style

However, once -webkit-overflow-scrolling : touch, is added to the scrolling container, performance is much better.

 

http://denniskuczynski.com/tests/mobile_tables/table_style?overflow=true

http://denniskuczynski.com/tests/mobile_tables/ul_style?overflow=true

See the source here:

https://gist.github.com/1888038 (Using tables)

https://gist.github.com/1888047 (Using unordered list items)

 

Note that, adding complicated HTML and CSS within these scrolling tables will start to degrade the scrolling performance, so the table HTML should be kept as simple as possible.

 

Installing CakePHP 1.3 on OS X Snow Leopard

I recently had to get some CakePHP code running on my local OS X environment.

CakePHP requires

  • an HTTP Server --Snow Leopard includes Apache that can use mod_rewrite
  • PHP 4.3.2 or greater -- Snow Leopard includes PHP 5.3
  • a database -- It's easy to install MySQL on OS X

Here's a great blog post to get all this setup:

Install Apache/PHP/MySQL on Snow Leopard

 

Next you just need to install CakePHP so it is visible in Apache's Document Root.

I created a new project folder on my hard drive's root, /cake_project and extracted the CakePHP 1.3 files downloaded from the website there.

Then updated the Apache httpd.conf file to setup the appropriate mod_rewrite and Document Root settings.

sudo vi /etc/apache2/httpd.conf

Editing:

DocumentRoot "/cake_project/app/webroot"

and

<Directory "/cake_project/app/webroot">

...

    AllowOverride All

Now just restart apache:
sudo apachectl restart

Ensure that /cake_project and it's underlying files have the correct permissions set.  (Remember that apache runs as the www user.)

And setup your cake config to point to your MySQL database.  (You will have to create a new database and users.)

Also, not that CakePHP 1.3 requires you to modify your /app/config/core.php file since you are using PHP 5.3.  Just uncomment this line:

/**
 * If you are on PHP 5.3 uncomment this line and correct your server timezone
 * to fix the date & time related errors.
 */
       //date_default_timezone_set('UTC');

And your CakePHP application should be visible by browsing to http://localhost

Let me know if it works!