Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Include the connection name in the query profiling section (Issue #1368) #1369

Closed
wants to merge 6 commits into
from

Conversation

Projects
None yet
3 participants

Little tweak to make profiling more useful.

@philsturgeon philsturgeon commented on an outdated diff May 23, 2012

system/libraries/Cache/Cache.php
@@ -117,7 +122,23 @@ public function __construct($config = array())
*/
public function get($id)
{
- return $this->{$this->_adapter}->get($id);
+ if( $this->save_queries )
@philsturgeon

philsturgeon May 23, 2012

Contributor

Please try and following the coding style guide and wrap with {'s on new lines.

@philsturgeon philsturgeon commented on an outdated diff May 23, 2012

system/libraries/Cache/Cache.php
@@ -132,7 +153,23 @@ public function get($id)
*/
public function save($id, $data, $ttl = 60)
{
- return $this->{$this->_adapter}->save($id, $data, $ttl);
+ if( $this->save_queries )
@philsturgeon

philsturgeon May 23, 2012

Contributor

Spaces are off, please use this:

if ($this->save_queries)

@narfbg narfbg commented on an outdated diff Jun 12, 2012

system/libraries/Cache/Cache.php
@@ -117,7 +122,23 @@ public function __construct($config = array())
*/
public function get($id)
{
- return $this->{$this->_adapter}->get($id);
+ if ($this->save_queries)
+ $this->queries[] = "get( '{$id}' )";
+
+ // Start the Query Timer
+ $time_start = list($sm, $ss) = explode(' ', microtime());
@narfbg

narfbg Jun 12, 2012

Contributor

Use microtime(TRUE) (on each such instance).

@narfbg narfbg commented on an outdated diff Jun 12, 2012

system/libraries/Cache/Cache.php
@@ -117,7 +122,23 @@ public function __construct($config = array())
*/
public function get($id)
{
- return $this->{$this->_adapter}->get($id);
+ if ($this->save_queries)
+ $this->queries[] = "get( '{$id}' )";
@narfbg

narfbg Jun 12, 2012

Contributor

This needs to be wrapped around in braces, see some examples in here: http://codeigniter.com/user_guide/general/styleguide.html#code_indenting

@narfbg narfbg commented on an outdated diff Jun 15, 2012

system/libraries/Cache/Cache.php
@@ -117,7 +122,27 @@ public function __construct($config = array())
*/
public function get($id)
{
- return $this->{$this->_adapter}->get($id);
+ if ($this->save_queries)
+ {
+ $this->queries[] = "get( '{$id}' )";
+ }
+
+ // Start the Query Timer
+ $time_start = list($sm, $ss) = explode(' ', microtime(TRUE));
@narfbg

narfbg Jun 15, 2012

Contributor

That's really not what I meant. microtime(TRUE) returns a float with the sum of your originally exploded values, it is used like this:

$time_start = microtime(TRUE);

// Do stuff

$time_end = microtime(TRUE);

$time_total = $time_end - $time_start;
Contributor

narfbg commented Nov 6, 2012

Partially implemented, see 55a8c62.
Please submit a separate pull request for Cache information.

@narfbg narfbg closed this Nov 6, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment