Sunday, 26 January 2014

How to: Use TAL Application Monitor to Trace Application Performance

As the scope of TV application keeps on expanding, we always get into a pitfall of being not considerate enough for low end devices. And the consequences could be devastating. Here, I am going to introduce a new way of benchmarking the performance of the TV application as new functionalities are being developed and also keeping an eye on its impact on performance.

* Pre-requisite

If your application is built upon TAL and Zend Framework, then you are good to go! 

* On the fly

1. Get TAL Performance Monitor from GitHub.

What it does is to manipulate TAL components with the custom behaviours, such as dumping FPS figures onto your terminal in this branch.

2. Create SymLink to 'talperformancemonitor.js' from tv application.

cd /<tvapplicationpath>/
ln -s /<talperformancemonitorpath>/talperformancemonitor.js talperformnacemonitor.js

3. Configure TV application header to launch with TAL Performance Monitor.

Drop in the following line in TV application header, which normally resides in <getApplicationSpecificHeader> tag in index.spv for application developed using Zend.

<script type="text/javascript" src="<?=$this->webapp->getScriptUrl('<tvapplicationname>')?>/talperformancemonitor.js"></script>

Or simply make sure 'talperformancemonitor.js' is used in the application to override TAL component.

4. Update host IP in 'talperformancemonitor.js'.

5. Turn off Firewall on the host machine, so that the loggings will not get blocked.

6. Execute 'server' script in TAL Performance Monitor and start the application. 

The remote feedback will be sent and displayed on the terminal as soon as there is any activity in the running instance.

So far, it is all done! Figures crossed :)

7. Use Cucumber to automate the scenarios and get output stacks. I will also post how to setup Cucumber BDD environment in due time.

* Improvements to TAL Performance Monitor

1. Create generic loggings for various TAL components.
2. Record performance information in database (NoSQL preferably).
3. Output and analyse recorded information as chart or other meaningful format.
4. Build into Continuos Integration to improve performance tracing.

No comments:

Post a Comment