Friday, October 24, 2014

Build Background Job in Laravel Using Cron Job

Cron Job with Laravel running with Artisan Command. So we have to make command using Artisan.

Generate Class.
php artisan command:make FooCommand 
php artisan command:make [[your command]]
This command will generate a class in app/commands.

Write Your Function
Write your functions in your generated command fire() method.

Register Command
Write: Artisan::add(new [[your command]]);
In app/start/artisan.php

Runs Cron Job
Write in terminal : crontab -e
* * * * * php [[path to application]]/[[your application]]/artisan background:process
* * * * * : it means this cron job will be executed every minutes

Wednesday, July 23, 2014

Record Scenario With Jmeter

Many of Us has difficulties to Record Scenario with Jmeter. Most problems appears in configurations and browser connection. I will try to explain step by step to setup Jmeter for recording scenario.

  1.  Right Click in Test Plan > Add > Thread Groups.
  2.  Right Click in Thread Groups > Add > HTTP Request Defaults. And filled your Server name or IP to be recorded by Jmeter.

  3. Right Click in Workbench > Non Test Elements > HTTP Proxy Servers. And fill available port, I used 8080.

  4. Drag HTTP Proxy Servers to below HTTP Request Defaults. Use "Insert Before" options. It should become like this:

  5. Right Click in Thread Groups > Logic Controller > Recording Controller.
  6. Right Click in Thread Groups > Listener > View Result Tree
  7. Right Click in Thread Groups > Listener > View Result in Table
  8. Go to File > Save As Test Plan. Save it.
  9. Open your FireFox browser. Go to Edit > Preferences > Advanced > Network > Settings

  10. Clik OK. And Open Jmeter.
  11. Go to HTTP Proxy Servers and click Start.
  12. Go to Your Browser, Type URL, and do the scenario.
  13. In Recording Controller it will appear some result, Expand it for further details.

  14. To watch Generation Time and more advanced recording, In your Jmeter go to Run start and open View Result Tree, it will collected all data in previous scenarios.