0554d545b40ee52c40d6d0b9afa365dfa26bc534
Author: Mark Story
Date: 2009-08-17 22:04:05 -0400
diff --git a/views/elements/timer_panel.ctp b/views/elements/timer_panel.ctp
index bb91bc2..63cdc1e 100644
--- a/views/elements/timer_panel.ctp
+++ b/views/elements/timer_panel.ctp
@@ -70,6 +70,7 @@ $headers = array(
$i = 0;
$values = array_values($timers);
+
foreach ($timers as $timerName => $timeInfo):
$indent = 0;
for ($j = 0; $j < $i; $j++) {
@@ -83,7 +84,8 @@ foreach ($timers as $timerName => $timeInfo):
$number->precision($timeInfo['time'] * 1000, 0),
$simpleGraph->bar(
$number->precision($timeInfo['time'] * 1000, 2),
- $number->precision($timeInfo['start'] * 1000, 2), array(
+ $number->precision($timeInfo['start'] * 1000, 2),
+ array(
'max' => $maxTime * 1000,
'requestTime' => $requestTime * 1000,
)
diff --git a/views/helpers/simple_graph.php b/views/helpers/simple_graph.php
index 1655f48..79a701f 100644
--- a/views/helpers/simple_graph.php
+++ b/views/helpers/simple_graph.php
@@ -32,16 +32,17 @@ class SimpleGraphHelper extends AppHelper {
* Default settings to be applied to each Simple Graph
*
* Allowed options:
- * max => int
- * width => int
- * valueType => string (value, percentage)
- * style => array
+ *
+ * - max => (int) Maximum value in the graphs
+ * - width => (int)
+ * - valueType => string (value, percentage)
+ * - style => array
*
* @var array
*/
var $__defaultSettings = array(
'max' => 100,
- 'width' => 250,
+ 'width' => 400,
'valueType' => 'value',
);
/**
@@ -57,14 +58,14 @@ class SimpleGraphHelper extends AppHelper {
$settings = array_merge($this->__defaultSettings, $options);
extract($settings);
- $_value = ($value / $max) * $width;
- $_value = max(round($_value), 1);
+ $graphValue = ($value / $max) * $width;
+ $graphValue = max(round($graphValue), 1);
if ($valueType == 'percentage') {
- $_offset = 0;
+ $graphOffset = 0;
} else {
- $_offset = ($offset / $max) * $width;
- $_offset = round($_offset);
+ $graphOffset = ($offset / $max) * $width;
+ $graphOffset = round($graphOffset);
}
return $this->Html->div(
'debug-kit-graph-bar',
@@ -72,7 +73,7 @@ class SimpleGraphHelper extends AppHelper {
'debug-kit-graph-bar-value',
' ',
array(
- 'style' => "margin-left: {$_offset}px; width: {$_value}px",
+ 'style' => "margin-left: {$graphOffset}px; width: {$graphValue}px",
'title' => sprintf(__("Starting %sms into the request, taking %sms", true), $offset, $value),
)
),
