dckap_speedanalyser - Version 0.1.0

Version Notes

Please add or uncomment "Varien_Profiler::enable();" in index.php file to make this module work.

Download this release

Release Info

Developer DCKAP Inc.
Extension dckap_speedanalyser
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/DCKAP/Speedanalyzer/Block/Adminhtml/Speedanalyzerbackend.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class DCKAP_Speedanalyzer_Block_Adminhtml_Speedanalyzerbackend extends Mage_Adminhtml_Block_Template {
4
+
5
+ }
app/code/community/DCKAP/Speedanalyzer/Block/Index.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class DCKAP_Speedanalyzer_Block_Index extends Mage_Core_Block_Template{
3
+
4
+
5
+
6
+
7
+
8
+ }
app/code/community/DCKAP/Speedanalyzer/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class DCKAP_Speedanalyzer_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+
app/code/community/DCKAP/Speedanalyzer/Model/Observer.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class DCKAP_Speedanalyzer_Model_Observer extends Mage_Core_Block_Abstract {
4
+
5
+ public function showSpeed(Varien_Event_Observer $observer) {
6
+
7
+ /* @var $timer Mage_Core_Block_Profiler */
8
+ $timers = Varien_Profiler::getTimers();
9
+ //print_r($timers);exit;
10
+ /* @var $block Mage_Core_Block_Abstract */
11
+ $block = $observer->getBlock();
12
+ $transport = $observer->getTransport();
13
+ $fileName = $block->getTemplateFile();
14
+ $thisClass = get_class($block);
15
+ $thisname = $block->getNameInLayout();
16
+ $fileLoadTime = number_format($timers[$fileName]['sum'],4);
17
+ $blockLoadTime = number_format($timers['BLOCK: '.$thisname]['sum'],4);
18
+ $fileLoadCount = $timers[$fileName]['count'];
19
+ $blockLoadCount = $timers['BLOCK: '.$thisname]['count'];
20
+ $showSpeedAnalyzer = Mage::getStoreConfig('speedanalyzer/general/speedanalyzerenable');
21
+ $showPath = Mage::getStoreConfig('speedanalyzer/general/templatepath');
22
+ $showTime = Mage::getStoreConfig('speedanalyzer/general/showtime');
23
+ $showCount = Mage::getStoreConfig('speedanalyzer/general/showcount');
24
+
25
+
26
+ //check if speedAnalyzer is enabled in backend and load time is more than 0
27
+ if($fileName && $fileLoadTime > 0 && $showSpeedAnalyzer) {
28
+ $preHtml = '<div style="position:relative; border:1px dotted red; margin:6px 2px; padding:18px 2px 2px 2px; zoom:1;">
29
+ <div style="position: absolute; z-index: 998; top: 0px; text-align: left ! important; left: 0px; font: 11px Arial; padding: 0px; background: none repeat scroll 0% 0% rgb(237, 63, 63); color: white; border: 1px solid rgb(255, 255, 255);" onmouseover="this.style.zIndex=\'999\'"
30
+ onmouseout="this.style.zIndex=\'998\'" title="'.$fileName.'">';
31
+ //check if showPath is enabled in backend
32
+ if($showPath)
33
+ $preHtml .= '<div style="float: left; margin: 2px;">'.$fileName.'</div>';
34
+ //check if showTime is enabled in backend
35
+ if($showTime)
36
+ $preHtml .= '<div style="float: right; width: 50px; padding: 2px 2px 2px 9px; background: none repeat scroll 0% 0% rgb(55, 55, 55);">'.$fileLoadTime.'</div>';
37
+ //check if showCount is enabled in backend
38
+ if($showCount)
39
+ $preHtml .= '<div style="color: white; float: right; width: 20px; padding: 2px 2px 2px 9px; background: none repeat scroll 0% 0% rgb(0, 195, 117);">'.$fileLoadCount.'</div>';
40
+ $preHtml .= '</div>';
41
+ if($blockLoadTime > 0){
42
+ $preHtml .= '<div style="position:absolute; right:0; top:0; padding:0; background: none repeat scroll 0% 0% rgb(237, 63, 63); color: white; border: 1px solid rgb(255, 255, 255);font:normal 11px Arial;
43
+ text-align:left !important; z-index:998;" onmouseover="this.style.zIndex=\'999\'" onmouseout="this.style.zIndex=\'998\'"title="'.$thisClass.'">';
44
+ //check if showPath is enabled in backend
45
+ if($showPath)
46
+ $preHtml .= '<div style="float: left; margin: 2px;">'.$thisClass.'</div>';
47
+ //check if showTime is enabled in backend
48
+ if($showTime)
49
+ $preHtml .= '<div style="float: right; width: 50px; padding: 2px 2px 2px 9px; background: none repeat scroll 0% 0% rgb(55, 55, 55);">'.$blockLoadTime.'</div>';
50
+ //check if showCount is enabled in backend
51
+ if($showCount)
52
+ $preHtml .= '<div style="color: white; float: right; width: 20px; padding: 2px 2px 2px 9px; background: none repeat scroll 0% 0% rgb(0, 195, 117);">'.$blockLoadCount.'</div>';
53
+
54
+ $preHtml .= '</div>';
55
+ }
56
+ $postHtml = '</div>';
57
+ }
58
+ else {
59
+ $preHtml = null;
60
+ $postHtml = null;
61
+ }
62
+
63
+
64
+ $html = $transport->getHtml();
65
+ $html = $preHtml . $html . $postHtml;
66
+ $transport->setHtml($html);
67
+
68
+ //endif;
69
+ }
70
+ }
app/code/community/DCKAP/Speedanalyzer/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <speedanalyzer translate="title" module="speedanalyzer">
12
+ <title>Speed Analyzer Section</title>
13
+ <sort_order>1</sort_order>
14
+ </speedanalyzer>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/DCKAP/Speedanalyzer/etc/config.xml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <DCKAP_Speedanalyzer>
5
+ <version>0.1.0</version>
6
+ </DCKAP_Speedanalyzer>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <speedanalyzer>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>DCKAP_Speedanalyzer</module>
14
+ <frontName>speedanalyzer</frontName>
15
+ </args>
16
+ </speedanalyzer>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <speedanalyzer>
21
+ <file>speedanalyzer.xml</file>
22
+ </speedanalyzer>
23
+ </updates>
24
+ </layout>
25
+ <events>
26
+ <core_block_abstract_to_html_after>
27
+ <observers>
28
+ <speed_analyzer>
29
+ <type>singleton</type>
30
+ <class>speedanalyzer/observer</class>
31
+ <method>showSpeed</method>
32
+ </speed_analyzer>
33
+ </observers>
34
+ </core_block_abstract_to_html_after>
35
+ </events>
36
+ </frontend>
37
+ <global>
38
+ <models>
39
+ <speedanalyzer>
40
+ <class>DCKAP_Speedanalyzer_Model</class>
41
+ </speedanalyzer>
42
+ </models>
43
+ <helpers>
44
+ <speedanalyzer>
45
+ <class>DCKAP_Speedanalyzer_Helper</class>
46
+ </speedanalyzer>
47
+ </helpers>
48
+ <blocks>
49
+ <speedanalyzer>
50
+ <class>DCKAP_Speedanalyzer_Block</class>
51
+ </speedanalyzer>
52
+ </blocks>
53
+
54
+ </global>
55
+ <admin>
56
+ <routers>
57
+ <speedanalyzer>
58
+ <use>admin</use>
59
+ <args>
60
+ <module>DCKAP_Speedanalyzer</module>
61
+ <frontName>speedanalyzer</frontName>
62
+ </args>
63
+ </speedanalyzer>
64
+ </routers>
65
+ </admin>
66
+ <adminhtml>
67
+ <acl>
68
+ <resources>
69
+ <all>
70
+ <title>Allow Everything</title>
71
+ </all>
72
+ <admin>
73
+ <children>
74
+ <speedanalyzer translate="title" module="speedanalyzer">
75
+ <title>Speedanalyzer</title>
76
+ <sort_order>1000</sort_order>
77
+ <children>
78
+ <speedanalyzerbackend translate="title">
79
+ <title>Backend Page Title</title>
80
+ </speedanalyzerbackend>
81
+ </children>
82
+ </speedanalyzer>
83
+ </children>
84
+ </admin>
85
+ </resources>
86
+ </acl>
87
+ <layout>
88
+ <updates>
89
+ <speedanalyzer>
90
+ <file>speedanalyzer.xml</file>
91
+ </speedanalyzer>
92
+ </updates>
93
+ </layout>
94
+ </adminhtml>
95
+ </config>
app/code/community/DCKAP/Speedanalyzer/etc/system.xml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <dckap translate="label" module="speedanalyzer">
5
+ <label>DCKAP</label>
6
+ <sort_order>500</sort_order>
7
+ </dckap>
8
+ </tabs>
9
+ <sections>
10
+ <speedanalyzer translate="label" module="speedanalyzer">
11
+ <label>Speed Analyzer</label>
12
+ <tab>dckap</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>10</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <general translate="label">
20
+ <label>General Configuration</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>1</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <speedanalyzerenable translate="label">
28
+ <label>Enable Speedanalyzer </label>
29
+ <comment>Please add or uncomment "Varien_Profiler::enable();" in index.php.</comment>
30
+ <frontend_type>select</frontend_type>
31
+ <source_model>adminhtml/system_config_source_yesno</source_model>
32
+ <sort_order>2</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ </speedanalyzerenable>
37
+ <templatepath translate="label">
38
+ <label>Enable Template Path</label>
39
+ <frontend_type>select</frontend_type>
40
+ <source_model>adminhtml/system_config_source_yesno</source_model>
41
+ <sort_order>3</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ </templatepath>
46
+ <showtime translate="label">
47
+ <label>Enable Time</label>
48
+ <frontend_type>select</frontend_type>
49
+ <source_model>adminhtml/system_config_source_yesno</source_model>
50
+ <sort_order>4</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ </showtime>
55
+ <showcount translate="label">
56
+ <label>Enable Count</label>
57
+ <frontend_type>select</frontend_type>
58
+ <source_model>adminhtml/system_config_source_yesno</source_model>
59
+ <sort_order>5</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ </showcount>
64
+ </fields>
65
+ </general>
66
+ </groups>
67
+ </speedanalyzer>
68
+ </sections>
69
+ </config>
app/code/community/DCKAP/Speedanalyzer/etc/system.xml~ ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <dckap translate="label" module="speedanalyzer">
5
+ <label>DCKAP</label>
6
+ <sort_order>400</sort_order>
7
+ </dckap>
8
+ </tabs>
9
+ <sections>
10
+ <speedanalyzer translate="label" module="speedanalyzer">
11
+ <label>Speed Analyzer</label>
12
+ <tab>dckap</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>1</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <general translate="label">
20
+ <label>General Configuration</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>1</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <speedanalyzerenable translate="label">
28
+ <label>Enable Speedanalyzer </label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>2</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </speedanalyzerenable>
36
+ <templatepath translate="label">
37
+ <label>Enable Template Path</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>adminhtml/system_config_source_yesno</source_model>
40
+ <sort_order>3</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </templatepath>
45
+ <showtime translate="label">
46
+ <label>Enable Time</label>
47
+ <frontend_type>select</frontend_type>
48
+ <source_model>adminhtml/system_config_source_yesno</source_model>
49
+ <sort_order>4</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ </showtime>
54
+ <showcount translate="label">
55
+ <label>Enable Count</label>
56
+ <frontend_type>select</frontend_type>
57
+ <source_model>adminhtml/system_config_source_yesno</source_model>
58
+ <sort_order>5</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ </showcount>
63
+ </fields>
64
+ </general>
65
+ </groups>
66
+ </speedanalyzer>
67
+ </sections>
68
+ </config>
app/etc/modules/DCKAP_Speedanalyzer.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <DCKAP_Speedanalyzer>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>0.1.0</version>
8
+ </DCKAP_Speedanalyzer>
9
+ </modules>
10
+ </config>
package.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>dckap_speedanalyser</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license>Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Speed Analyzer helps to analyze the performance of every block and template in the Magento site. </summary>
10
+ <description>With precise Block Loading time, Speed Analyzer helps to track down the block which consumes majority of the bandwidth. &#xD;
11
+ &#xD;
12
+ Speed Analyzer shows Path of Template and Block , Loading Time and Count.&#xD;
13
+ &#xD;
14
+ Based on the data obtained from Magento Profiler, Speed Analyzer depicts the data across each block so that the high bandwidth block can be optimized for better performance.&#xD;
15
+ </description>
16
+ <notes>Please add or uncomment "Varien_Profiler::enable();" in index.php file to make this module work.</notes>
17
+ <authors><author><name>DCKAP Inc.</name><user>DCKAP</user><email>magento@dckap.com</email></author></authors>
18
+ <date>2014-12-26</date>
19
+ <time>12:43:12</time>
20
+ <contents><target name="magecommunity"><dir name="DCKAP"><dir name="Speedanalyzer"><dir name="Block"><dir name="Adminhtml"><file name="Speedanalyzerbackend.php" hash="a0d9843ac2eb56136435aa5e1ed2cbff"/></dir><file name="Index.php" hash="37180667a88a56c829f72dd894e7d4cb"/></dir><dir name="Helper"><file name="Data.php" hash="dfc379116e166c99c966f25f9ace882d"/></dir><dir name="Model"><file name="Observer.php" hash="830db9175b893f5cfd6b842216e7b999"/><file name="Observer_new.php" hash=""/></dir><dir name="etc"><file name="adminhtml.xml" hash="2b2d5a0b678c4af4ad41cbadd74baa01"/><file name="config.xml" hash="0f45228cf4c207ba44a75c36720cd99f"/><file name="system.xml" hash="7ba611cbdc1a4b3e84903a7455046283"/><file name="system.xml~" hash="e947eb5ffdd98d7a29e7d035d0abfa8b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DCKAP_Speedanalyzer.xml" hash="29fe5034074f0ad043ed9b4ad01c77dc"/></dir></target></contents>
21
+ <compatible/>
22
+ <dependencies><required><php><min>5.1.0</min><max>5.6.0</max></php></required></dependencies>
23
+ </package>