PageRenderTime 61ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/parivartree260614/parivartree/app/cache/dev/twig/fd/5d/89a26ff7de31f05f73105be54480ea3fcc75ae9babf1a3aff0b0591c4d68.php

https://github.com/roopalidudalkar/parivartree
PHP | 837 lines | 622 code | 97 blank | 118 comment | 39 complexity | e1bb4718d5651ba24a10f30622943753 MD5 | raw file
  1. <?php
  2. /* WebProfilerBundle:Collector:time.html.twig */
  3. class __TwigTemplate_fd5d89a26ff7de31f05f73105be54480ea3fcc75ae9babf1a3aff0b0591c4d68 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. $this->parent = $this->env->loadTemplate("@WebProfiler/Profiler/layout.html.twig");
  9. $this->blocks = array(
  10. 'toolbar' => array($this, 'block_toolbar'),
  11. 'menu' => array($this, 'block_menu'),
  12. 'panel' => array($this, 'block_panel'),
  13. 'panelContent' => array($this, 'block_panelContent'),
  14. );
  15. }
  16. protected function doGetParent(array $context)
  17. {
  18. return "@WebProfiler/Profiler/layout.html.twig";
  19. }
  20. protected function doDisplay(array $context, array $blocks = array())
  21. {
  22. // line 3
  23. $context["__internal_73f281c4dc109eb828f42c473ab7a4162ecb9416a00239915790be94adb81cae"] = $this;
  24. // line 5
  25. if ((!array_key_exists("colors", $context))) {
  26. // line 6
  27. $context["colors"] = array("default" => "#aacd4e", "section" => "#666", "event_listener" => "#3dd", "event_listener_loading" => "#add", "template" => "#dd3", "doctrine" => "#d3d", "propel" => "#f4d", "child_sections" => "#eed");
  28. }
  29. $this->parent->display($context, array_merge($this->blocks, $blocks));
  30. }
  31. // line 18
  32. public function block_toolbar($context, array $blocks = array())
  33. {
  34. // line 19
  35. echo " ";
  36. $context["duration"] = ((twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "collector"), "events"))) ? (sprintf("%.0f ms", $this->getAttribute($this->getContext($context, "collector"), "duration"))) : ("n/a"));
  37. // line 20
  38. echo " ";
  39. ob_start();
  40. // line 21
  41. echo " <img width=\"16\" height=\"28\" alt=\"Time\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAcCAYAAABoMT8aAAABqUlEQVR42t2Vv0sCYRyHX9OmEhsMx/YKGlwLQ69DTEUSBJEQEy5J3FRc/BsuiFqEIIcQIRo6ysUhoaBBWhoaGoJwiMJLglRKrs8bXgienmkQdPDAwX2f57j3fhFJkkbiPwTK5bIiFoul3kmPud8MqKMewDXpwuGww+12n9hsNhFnlijYf/Z4PDmO45Yxo+10ZFGTyWRMEItU6AdCx7lczkgd6n7J2Wx2xm63P6jJMk6n80YQBBN1aUDv9XqvlAbbm2LE7/cLODRB0un0VveAeoDC8/waCQQC18MGQqHQOcEKvw8bcLlcL6TfYnVtCrGRAlartUUYhmn1jKg/E3USjUYfhw3E4/F7ks/nz4YNFIvFQ/ogbUYikdefyqlU6gnuOg2YK5XKvs/n+xhUDgaDTVEUt+HO04ABOBA5isViDTU5kUi81Wq1AzhWMEkDGmAEq2C3UCjcYXGauDvfEsuyUjKZbJRKpVvM8IABU9SVX+cxYABmwIE9cFqtVi9xtgvsC2AHbIAFoKey0gdlHEyDObAEWLACFsEsMALdIJ80+dK0bTS95v7+v/AJnis0eO906QwAAAAASUVORK5CYII=\" />
  42. <span>";
  43. // line 22
  44. echo twig_escape_filter($this->env, $this->getContext($context, "duration"), "html", null, true);
  45. echo "</span>
  46. ";
  47. $context["icon"] = ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  48. // line 24
  49. echo " ";
  50. ob_start();
  51. // line 25
  52. echo " <div class=\"sf-toolbar-info-piece\">
  53. <b>Total time</b>
  54. <span>";
  55. // line 27
  56. echo twig_escape_filter($this->env, $this->getContext($context, "duration"), "html", null, true);
  57. echo "</span>
  58. </div>
  59. ";
  60. $context["text"] = ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  61. // line 30
  62. echo " ";
  63. $this->env->loadTemplate("@WebProfiler/Profiler/toolbar_item.html.twig")->display(array_merge($context, array("link" => $this->getContext($context, "profiler_url"))));
  64. }
  65. // line 33
  66. public function block_menu($context, array $blocks = array())
  67. {
  68. // line 34
  69. echo "<span class=\"label\">
  70. <span class=\"icon\"><img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAhCAYAAADOHBvaAAACz0lEQVR42t2XXWhSYRjHc+pyWrC10e66qKggiGoF0Qh1SBPFDxCcX00yrG6EImFsRhAuvUjwQgZB1EUICYEkgRJGB0QmKMNGEYx1URYEg2w6amWY/YUXXH7Ms9M5RAk/PByf8/58P573ec+2Wq32V/g3xFKpdB3UQBV8JVTJvXUuxbXN+P96TODNzMzsNJvNo3UCgYCYszmmKKrPYrE4NBrNU7lcvtY8xGNjYyWtVvvEZrPZES9kQyy02+3nx8fH3xFJV5RK5RuHw2GqP8tInEgk+g0GwyN6wlZMJtPdfD6/Y0viVCo1iKHLMpM20Ov1FNqT0BWLsWhiXdImDyiQ7ybHVN1HnKibWHgNHxr5egXI6t90ej49PX0BsYKO4qWlpT1qtXqFhlhGnpHREWPaPiB2dydxL/7ZTRLMnpjg8/lcpNct4mGr1fqSK7HT6UwhfleLuFwuH1EoFBWuxDqd7jPiDzSLe+Lx+AQJYl9MKBQKZ+pb7kaxKBKJXGUgPgqCgGrQOc3S6fQEfuNvFEtisdgUA3E/kcsadE6zhYUFG9lKG2LcvMxA3EKnKUBx+bm6uqptFvcCtUql+kECWcdoNH6BQw56fltcYNTtdr/nSuzxeJbhONkujw9Fo9EYV+JkMvkAjv3txEOVSuUSytk3tqWoz2to/xwYaCcWgtPI5+dsSrGo6mn0GG2PtG6ZDYbBRb/f/5EtcSgUeos2J8HgpmURHMaQz6JglP5U6vV6P6G962Sr5HcUE/rAKXB7bm5uhenwhsPheim8BUa6HwQaSMjSv5HNZl+gstDOb5fL9X1xcTGLZ6fAMSDe6ilTBA4CO7iXyWReB4PBMo5F1WYZymkVc1nK5XKvEHsHWMA+sJ3p8VYAhkjvJ4EPRMCzYrE4XyqV5nGdBA/BLLCC46Tu8tl4kxCAAdKLE0AGzhKkZB73kqIh4PI1lQf4BB6TNn4B8KR3FN9bp4MAAAAASUVORK5CYII=\" alt=\"Timeline\"></span>
  71. <strong>Timeline</strong>
  72. </span>
  73. ";
  74. }
  75. // line 40
  76. public function block_panel($context, array $blocks = array())
  77. {
  78. // line 41
  79. echo " <h2>Timeline</h2>
  80. ";
  81. // line 42
  82. if (twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "collector"), "events"))) {
  83. // line 43
  84. echo " ";
  85. $this->displayBlock("panelContent", $context, $blocks);
  86. echo "
  87. ";
  88. } else {
  89. // line 45
  90. echo " <p>
  91. <em>No timing events have been recorded. Are you sure that debugging is enabled in the kernel?</em>
  92. </p>
  93. ";
  94. }
  95. }
  96. // line 51
  97. public function block_panelContent($context, array $blocks = array())
  98. {
  99. // line 52
  100. echo " <form id=\"timeline-control\" action=\"\" method=\"get\">
  101. <input type=\"hidden\" name=\"panel\" value=\"time\">
  102. <table>
  103. <tr>
  104. <th style=\"width: 20%\">Total time</th>
  105. <td>";
  106. // line 57
  107. echo twig_escape_filter($this->env, sprintf("%.0f", $this->getAttribute($this->getContext($context, "collector"), "duration")), "html", null, true);
  108. echo " ms</td>
  109. </tr>
  110. <tr>
  111. <th>Initialization time</th>
  112. <td>";
  113. // line 61
  114. echo twig_escape_filter($this->env, sprintf("%.0f", $this->getAttribute($this->getContext($context, "collector"), "inittime")), "html", null, true);
  115. echo " ms</td>
  116. </tr>
  117. <tr>
  118. <th>Threshold</th>
  119. <td><input type=\"number\" size=\"3\" name=\"threshold\" value=\"1\" min=\"0\"> ms</td>
  120. </tr>
  121. </table>
  122. </form>
  123. <h3>
  124. ";
  125. // line 71
  126. echo (($this->getAttribute($this->getContext($context, "profile"), "parent")) ? ("Request") : ("Main Request"));
  127. echo "
  128. <small>
  129. - ";
  130. // line 73
  131. echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "duration"), "html", null, true);
  132. echo " ms
  133. ";
  134. // line 74
  135. if ($this->getAttribute($this->getContext($context, "profile"), "parent")) {
  136. // line 75
  137. echo " - <a href=\"";
  138. echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_profiler", array("token" => $this->getAttribute($this->getAttribute($this->getContext($context, "profile"), "parent"), "token"), "panel" => "time")), "html", null, true);
  139. echo "\">parent</a>
  140. ";
  141. }
  142. // line 77
  143. echo " </small>
  144. </h3>
  145. ";
  146. // line 80
  147. echo $context["__internal_73f281c4dc109eb828f42c473ab7a4162ecb9416a00239915790be94adb81cae"]->getdisplay_timeline(("timeline_" . $this->getContext($context, "token")), $this->getAttribute($this->getContext($context, "collector"), "events"), $this->getContext($context, "colors"));
  148. echo "
  149. ";
  150. // line 82
  151. if (twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "profile"), "children"))) {
  152. // line 83
  153. echo " ";
  154. $context['_parent'] = (array) $context;
  155. $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "profile"), "children"));
  156. foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
  157. // line 84
  158. echo " ";
  159. $context["events"] = $this->getAttribute($this->getAttribute($this->getContext($context, "child"), "getcollector", array(0 => "time"), "method"), "events");
  160. // line 85
  161. echo " <h3>
  162. Sub-request \"<a href=\"";
  163. // line 86
  164. echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_profiler", array("token" => $this->getAttribute($this->getContext($context, "child"), "token"), "panel" => "time")), "html", null, true);
  165. echo "\">";
  166. echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "child"), "getcollector", array(0 => "request"), "method"), "requestattributes"), "get", array(0 => "_controller"), "method"), "html", null, true);
  167. echo "</a>\"
  168. <small> - ";
  169. // line 87
  170. echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "events"), "__section__"), "duration"), "html", null, true);
  171. echo " ms</small>
  172. </h3>
  173. ";
  174. // line 90
  175. echo $context["__internal_73f281c4dc109eb828f42c473ab7a4162ecb9416a00239915790be94adb81cae"]->getdisplay_timeline(("timeline_" . $this->getAttribute($this->getContext($context, "child"), "token")), $this->getContext($context, "events"), $this->getContext($context, "colors"));
  176. echo "
  177. ";
  178. }
  179. $_parent = $context['_parent'];
  180. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
  181. $context = array_intersect_key($context, $_parent) + $_parent;
  182. // line 92
  183. echo " ";
  184. }
  185. // line 93
  186. echo "
  187. <script>";
  188. // line 94
  189. echo "//<![CDATA[
  190. /**
  191. * In-memory key-value cache manager
  192. */
  193. var cache = new function() {
  194. \"use strict\";
  195. var dict = {};
  196. this.get = function(key) {
  197. return dict.hasOwnProperty(key)
  198. ? dict[key]
  199. : null;
  200. }
  201. this.set = function(key, value) {
  202. dict[key] = value;
  203. return value;
  204. }
  205. };
  206. /**
  207. * Query an element with a CSS selector.
  208. *
  209. * @param string selector a CSS-selector-compatible query string.
  210. *
  211. * @return DOMElement|null
  212. */
  213. function query(selector)
  214. {
  215. \"use strict\";
  216. var key = 'SELECTOR: ' + selector;
  217. return cache.get(key) || cache.set(key, document.querySelector(selector));
  218. }
  219. /**
  220. * Canvas Manager
  221. */
  222. function CanvasManager(requests, maxRequestTime) {
  223. \"use strict\";
  224. var _drawingColors = ";
  225. // line 136
  226. echo twig_jsonencode_filter($this->getContext($context, "colors"));
  227. echo ",
  228. _storagePrefix = 'timeline/',
  229. _threshold = 1,
  230. _requests = requests,
  231. _maxRequestTime = maxRequestTime;
  232. /**
  233. * Check whether this event is a child event.
  234. *
  235. * @return true if it is.
  236. */
  237. function isChildEvent(event)
  238. {
  239. return '__section__.child' === event.name;
  240. }
  241. /**
  242. * Check whether this event is categorized in 'section'.
  243. *
  244. * @return true if it is.
  245. */
  246. function isSectionEvent(event)
  247. {
  248. return 'section' === event.category;
  249. }
  250. /**
  251. * Get the width of the container.
  252. */
  253. function getContainerWidth()
  254. {
  255. return query('#collector-content h2').clientWidth;
  256. }
  257. /**
  258. * Draw one canvas.
  259. *
  260. * @param request the request object
  261. * @param max <subjected for removal>
  262. * @param threshold the threshold (lower bound) of the length of the timeline (in milliseconds).
  263. * @param width the width of the canvas.
  264. */
  265. this.drawOne = function(request, max, threshold, width)
  266. {
  267. \"use strict\";
  268. var text,
  269. ms,
  270. xc,
  271. drawableEvents,
  272. mainEvents,
  273. elementId = 'timeline_' + request.id,
  274. canvasHeight = 0,
  275. gapPerEvent = 38,
  276. colors = _drawingColors,
  277. space = 10.5,
  278. ratio = (width - space * 2) / max,
  279. h = space,
  280. x = request.left * ratio + space, // position
  281. canvas = cache.get(elementId) || cache.set(elementId, document.getElementById(elementId)),
  282. ctx = canvas.getContext(\"2d\"),
  283. backingStoreRatio,
  284. scaleRatio,
  285. devicePixelRatio;
  286. // Filter events whose total time is below the threshold.
  287. drawableEvents = request.events.filter(function(event) {
  288. return event.duration >= threshold;
  289. });
  290. canvasHeight += gapPerEvent * drawableEvents.length;
  291. // For retina displays so text and boxes will be crisp
  292. devicePixelRatio = window.devicePixelRatio == \"undefined\" ? 1 : window.devicePixelRatio;
  293. backingStoreRatio = ctx.webkitBackingStorePixelRatio == \"undefined\" ? 1 : ctx.webkitBackingStorePixelRatio;
  294. scaleRatio = devicePixelRatio / 1;
  295. canvasHeight += gapPerEvent * drawableEvents.length;
  296. canvas.width = width * scaleRatio;
  297. canvas.height = canvasHeight * scaleRatio;
  298. canvas.style.width = width + 'px';
  299. canvas.style.height = canvasHeight + 'px';
  300. ctx.scale(scaleRatio, scaleRatio);
  301. ctx.textBaseline = \"middle\";
  302. ctx.lineWidth = 0;
  303. // For each event, draw a line.
  304. ctx.strokeStyle = \"#dfdfdf\";
  305. drawableEvents.forEach(function(event) {
  306. event.periods.forEach(function(period) {
  307. var timelineHeadPosition = x + period.start * ratio;
  308. if (isChildEvent(event)) {
  309. ctx.fillStyle = colors.child_sections;
  310. ctx.fillRect(timelineHeadPosition, 0, (period.end - period.start) * ratio, canvasHeight);
  311. } else if (isSectionEvent(event)) {
  312. var timelineTailPosition = x + period.end * ratio;
  313. ctx.beginPath();
  314. ctx.moveTo(timelineHeadPosition, 0);
  315. ctx.lineTo(timelineHeadPosition, canvasHeight);
  316. ctx.moveTo(timelineTailPosition, 0);
  317. ctx.lineTo(timelineTailPosition, canvasHeight);
  318. ctx.fill();
  319. ctx.closePath();
  320. ctx.stroke();
  321. }
  322. });
  323. });
  324. // Filter for main events.
  325. mainEvents = drawableEvents.filter(function(event) {
  326. return !isChildEvent(event)
  327. });
  328. // For each main event, draw the visual presentation of timelines.
  329. mainEvents.forEach(function(event) {
  330. h += 8;
  331. // For each sub event, ...
  332. event.periods.forEach(function(period) {
  333. // Set the drawing style.
  334. ctx.fillStyle = colors['default'];
  335. ctx.strokeStyle = colors['default'];
  336. if (colors[event.name]) {
  337. ctx.fillStyle = colors[event.name];
  338. ctx.strokeStyle = colors[event.name];
  339. } else if (colors[event.category]) {
  340. ctx.fillStyle = colors[event.category];
  341. ctx.strokeStyle = colors[event.category];
  342. }
  343. // Draw the timeline
  344. var timelineHeadPosition = x + period.start * ratio;
  345. if (!isSectionEvent(event)) {
  346. ctx.fillRect(timelineHeadPosition, h + 3, 2, 6);
  347. ctx.fillRect(timelineHeadPosition, h, (period.end - period.start) * ratio || 2, 6);
  348. } else {
  349. var timelineTailPosition = x + period.end * ratio;
  350. ctx.beginPath();
  351. ctx.moveTo(timelineHeadPosition, h);
  352. ctx.lineTo(timelineHeadPosition, h + 11);
  353. ctx.lineTo(timelineHeadPosition + 8, h);
  354. ctx.lineTo(timelineHeadPosition, h);
  355. ctx.fill();
  356. ctx.closePath();
  357. ctx.stroke();
  358. ctx.beginPath();
  359. ctx.moveTo(timelineTailPosition, h);
  360. ctx.lineTo(timelineTailPosition, h + 11);
  361. ctx.lineTo(timelineTailPosition - 8, h);
  362. ctx.lineTo(timelineTailPosition, h);
  363. ctx.fill();
  364. ctx.closePath();
  365. ctx.stroke();
  366. ctx.beginPath();
  367. ctx.moveTo(timelineHeadPosition, h);
  368. ctx.lineTo(timelineTailPosition, h);
  369. ctx.lineTo(timelineTailPosition, h + 2);
  370. ctx.lineTo(timelineHeadPosition, h + 2);
  371. ctx.lineTo(timelineHeadPosition, h);
  372. ctx.fill();
  373. ctx.closePath();
  374. ctx.stroke();
  375. }
  376. });
  377. h += 30;
  378. ctx.beginPath();
  379. ctx.strokeStyle = \"#dfdfdf\";
  380. ctx.moveTo(0, h - 10);
  381. ctx.lineTo(width, h - 10);
  382. ctx.closePath();
  383. ctx.stroke();
  384. });
  385. h = space;
  386. // For each event, draw the label.
  387. mainEvents.forEach(function(event) {
  388. ctx.fillStyle = \"#444\";
  389. ctx.font = \"12px sans-serif\";
  390. text = event.name;
  391. ms = \" ~ \" + (event.duration < 1 ? event.duration : parseInt(event.duration, 10)) + \" ms / ~ \" + event.memory + \" MB\";
  392. if (x + event.starttime * ratio + ctx.measureText(text + ms).width > width) {
  393. ctx.textAlign = \"end\";
  394. ctx.font = \"10px sans-serif\";
  395. xc = x + event.endtime * ratio - 1;
  396. ctx.fillText(ms, xc, h);
  397. xc -= ctx.measureText(ms).width;
  398. ctx.font = \"12px sans-serif\";
  399. ctx.fillText(text, xc, h);
  400. } else {
  401. ctx.textAlign = \"start\";
  402. ctx.font = \"12px sans-serif\";
  403. xc = x + event.starttime * ratio + 1;
  404. ctx.fillText(text, xc, h);
  405. xc += ctx.measureText(text).width;
  406. ctx.font = \"10px sans-serif\";
  407. ctx.fillText(ms, xc, h);
  408. }
  409. h += gapPerEvent;
  410. });
  411. };
  412. this.drawAll = function(width, threshold)
  413. {
  414. \"use strict\";
  415. width = width || getContainerWidth();
  416. threshold = threshold || this.getThreshold();
  417. var self = this;
  418. _requests.forEach(function(request) {
  419. self.drawOne(request, maxRequestTime, threshold, width);
  420. });
  421. };
  422. this.getThreshold = function() {
  423. var threshold = Sfjs.getPreference(_storagePrefix + 'threshold');
  424. if (threshold === null) {
  425. return _threshold;
  426. }
  427. _threshold = parseInt(threshold);
  428. return _threshold;
  429. };
  430. this.setThreshold = function(threshold)
  431. {
  432. _threshold = threshold;
  433. Sfjs.setPreference(_storagePrefix + 'threshold', threshold);
  434. return this;
  435. };
  436. };
  437. function canvasAutoUpdateOnResizeAndSubmit(e) {
  438. e.preventDefault();
  439. canvasManager.drawAll();
  440. }
  441. function canvasAutoUpdateOnThresholdChange(e) {
  442. canvasManager
  443. .setThreshold(query('input[name=\"threshold\"]').value)
  444. .drawAll();
  445. }
  446. var requests_data = {
  447. \"max\": ";
  448. // line 404
  449. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "endtime")), "js", null, true);
  450. echo ",
  451. \"requests\": [
  452. ";
  453. // line 406
  454. echo $context["__internal_73f281c4dc109eb828f42c473ab7a4162ecb9416a00239915790be94adb81cae"]->getdump_request_data($this->getContext($context, "token"), $this->getContext($context, "profile"), $this->getAttribute($this->getContext($context, "collector"), "events"), $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "origin"));
  455. echo "
  456. ";
  457. // line 408
  458. if (twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "profile"), "children"))) {
  459. // line 409
  460. echo " ,
  461. ";
  462. // line 410
  463. $context['_parent'] = (array) $context;
  464. $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "profile"), "children"));
  465. $context['loop'] = array(
  466. 'parent' => $context['_parent'],
  467. 'index0' => 0,
  468. 'index' => 1,
  469. 'first' => true,
  470. );
  471. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  472. $length = count($context['_seq']);
  473. $context['loop']['revindex0'] = $length - 1;
  474. $context['loop']['revindex'] = $length;
  475. $context['loop']['length'] = $length;
  476. $context['loop']['last'] = 1 === $length;
  477. }
  478. foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
  479. // line 411
  480. echo $context["__internal_73f281c4dc109eb828f42c473ab7a4162ecb9416a00239915790be94adb81cae"]->getdump_request_data($this->getAttribute($this->getContext($context, "child"), "token"), $this->getContext($context, "child"), $this->getAttribute($this->getAttribute($this->getContext($context, "child"), "getcollector", array(0 => "time"), "method"), "events"), $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "origin"));
  481. echo (($this->getAttribute($this->getContext($context, "loop"), "last")) ? ("") : (","));
  482. echo "
  483. ";
  484. ++$context['loop']['index0'];
  485. ++$context['loop']['index'];
  486. $context['loop']['first'] = false;
  487. if (isset($context['loop']['length'])) {
  488. --$context['loop']['revindex0'];
  489. --$context['loop']['revindex'];
  490. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  491. }
  492. }
  493. $_parent = $context['_parent'];
  494. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
  495. $context = array_intersect_key($context, $_parent) + $_parent;
  496. }
  497. // line 414
  498. echo " ]
  499. };
  500. var canvasManager = new CanvasManager(requests_data.requests, requests_data.max);
  501. query('input[name=\"threshold\"]').value = canvasManager.getThreshold();
  502. canvasManager.drawAll();
  503. // Update the colors of legends.
  504. var timelineLegends = document.querySelectorAll('.sf-profiler-timeline > .legends > span[data-color]');
  505. for (var i = 0; i < timelineLegends.length; ++i) {
  506. var timelineLegend = timelineLegends[i];
  507. timelineLegend.style.borderLeftColor = timelineLegend.getAttribute('data-color');
  508. }
  509. // Bind event handlers
  510. var elementTimelineControl = query('#timeline-control'),
  511. elementThresholdControl = query('input[name=\"threshold\"]');
  512. window.onresize = canvasAutoUpdateOnResizeAndSubmit;
  513. elementTimelineControl.onsubmit = canvasAutoUpdateOnResizeAndSubmit;
  514. elementThresholdControl.onclick = canvasAutoUpdateOnThresholdChange;
  515. elementThresholdControl.onchange = canvasAutoUpdateOnThresholdChange;
  516. elementThresholdControl.onkeyup = canvasAutoUpdateOnThresholdChange;
  517. window.setTimeout(function() {
  518. canvasAutoUpdateOnThresholdChange(null);
  519. }, 50);
  520. //]]>";
  521. // line 446
  522. echo "</script>
  523. ";
  524. }
  525. // line 449
  526. public function getdump_request_data($_token = null, $_profile = null, $_events = null, $_origin = null)
  527. {
  528. $context = $this->env->mergeGlobals(array(
  529. "token" => $_token,
  530. "profile" => $_profile,
  531. "events" => $_events,
  532. "origin" => $_origin,
  533. ));
  534. $blocks = array();
  535. ob_start();
  536. try {
  537. // line 451
  538. $context["__internal_e7dd6c3faebf33229115964b0baaa117ccea9d7a6d2df649ea88802f16a640b0"] = $this;
  539. // line 452
  540. echo " {
  541. \"id\": \"";
  542. // line 453
  543. echo twig_escape_filter($this->env, $this->getContext($context, "token"), "js", null, true);
  544. echo "\",
  545. \"left\": ";
  546. // line 454
  547. echo twig_escape_filter($this->env, sprintf("%F", ($this->getAttribute($this->getAttribute($this->getContext($context, "events"), "__section__"), "origin") - $this->getContext($context, "origin"))), "js", null, true);
  548. echo ",
  549. \"events\": [
  550. ";
  551. // line 456
  552. echo $context["__internal_e7dd6c3faebf33229115964b0baaa117ccea9d7a6d2df649ea88802f16a640b0"]->getdump_events($this->getContext($context, "events"));
  553. echo "
  554. ]
  555. }
  556. ";
  557. } catch (Exception $e) {
  558. ob_end_clean();
  559. throw $e;
  560. }
  561. return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  562. }
  563. // line 462
  564. public function getdump_events($_events = null)
  565. {
  566. $context = $this->env->mergeGlobals(array(
  567. "events" => $_events,
  568. ));
  569. $blocks = array();
  570. ob_start();
  571. try {
  572. // line 464
  573. $context['_parent'] = (array) $context;
  574. $context['_seq'] = twig_ensure_traversable($this->getContext($context, "events"));
  575. $context['loop'] = array(
  576. 'parent' => $context['_parent'],
  577. 'index0' => 0,
  578. 'index' => 1,
  579. 'first' => true,
  580. );
  581. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  582. $length = count($context['_seq']);
  583. $context['loop']['revindex0'] = $length - 1;
  584. $context['loop']['revindex'] = $length;
  585. $context['loop']['length'] = $length;
  586. $context['loop']['last'] = 1 === $length;
  587. }
  588. foreach ($context['_seq'] as $context["name"] => $context["event"]) {
  589. // line 465
  590. if (("__section__" != $this->getContext($context, "name"))) {
  591. // line 466
  592. echo " {
  593. \"name\": \"";
  594. // line 467
  595. echo twig_escape_filter($this->env, $this->getContext($context, "name"), "js", null, true);
  596. echo "\",
  597. \"category\": \"";
  598. // line 468
  599. echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "event"), "category"), "js", null, true);
  600. echo "\",
  601. \"origin\": ";
  602. // line 469
  603. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "origin")), "js", null, true);
  604. echo ",
  605. \"starttime\": ";
  606. // line 470
  607. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "starttime")), "js", null, true);
  608. echo ",
  609. \"endtime\": ";
  610. // line 471
  611. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "endtime")), "js", null, true);
  612. echo ",
  613. \"duration\": ";
  614. // line 472
  615. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "duration")), "js", null, true);
  616. echo ",
  617. \"memory\": ";
  618. // line 473
  619. echo twig_escape_filter($this->env, sprintf("%.1F", (($this->getAttribute($this->getContext($context, "event"), "memory") / 1024) / 1024)), "js", null, true);
  620. echo ",
  621. \"periods\": [";
  622. // line 475
  623. $context['_parent'] = (array) $context;
  624. $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "event"), "periods"));
  625. $context['loop'] = array(
  626. 'parent' => $context['_parent'],
  627. 'index0' => 0,
  628. 'index' => 1,
  629. 'first' => true,
  630. );
  631. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  632. $length = count($context['_seq']);
  633. $context['loop']['revindex0'] = $length - 1;
  634. $context['loop']['revindex'] = $length;
  635. $context['loop']['length'] = $length;
  636. $context['loop']['last'] = 1 === $length;
  637. }
  638. foreach ($context['_seq'] as $context["_key"] => $context["period"]) {
  639. // line 476
  640. echo "{\"start\": ";
  641. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "period"), "starttime")), "js", null, true);
  642. echo ", \"end\": ";
  643. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "period"), "endtime")), "js", null, true);
  644. echo "}";
  645. echo (($this->getAttribute($this->getContext($context, "loop"), "last")) ? ("") : (", "));
  646. ++$context['loop']['index0'];
  647. ++$context['loop']['index'];
  648. $context['loop']['first'] = false;
  649. if (isset($context['loop']['length'])) {
  650. --$context['loop']['revindex0'];
  651. --$context['loop']['revindex'];
  652. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  653. }
  654. }
  655. $_parent = $context['_parent'];
  656. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['period'], $context['_parent'], $context['loop']);
  657. $context = array_intersect_key($context, $_parent) + $_parent;
  658. // line 478
  659. echo "]
  660. }";
  661. // line 479
  662. echo (($this->getAttribute($this->getContext($context, "loop"), "last")) ? ("") : (","));
  663. echo "
  664. ";
  665. }
  666. ++$context['loop']['index0'];
  667. ++$context['loop']['index'];
  668. $context['loop']['first'] = false;
  669. if (isset($context['loop']['length'])) {
  670. --$context['loop']['revindex0'];
  671. --$context['loop']['revindex'];
  672. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  673. }
  674. }
  675. $_parent = $context['_parent'];
  676. unset($context['_seq'], $context['_iterated'], $context['name'], $context['event'], $context['_parent'], $context['loop']);
  677. $context = array_intersect_key($context, $_parent) + $_parent;
  678. } catch (Exception $e) {
  679. ob_end_clean();
  680. throw $e;
  681. }
  682. return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  683. }
  684. // line 485
  685. public function getdisplay_timeline($_id = null, $_events = null, $_colors = null)
  686. {
  687. $context = $this->env->mergeGlobals(array(
  688. "id" => $_id,
  689. "events" => $_events,
  690. "colors" => $_colors,
  691. ));
  692. $blocks = array();
  693. ob_start();
  694. try {
  695. // line 486
  696. echo " <div class=\"sf-profiler-timeline\">
  697. <div class=\"legends\">
  698. ";
  699. // line 488
  700. $context['_parent'] = (array) $context;
  701. $context['_seq'] = twig_ensure_traversable($this->getContext($context, "colors"));
  702. foreach ($context['_seq'] as $context["category"] => $context["color"]) {
  703. // line 489
  704. echo " <span data-color=\"";
  705. echo twig_escape_filter($this->env, $this->getContext($context, "color"), "html", null, true);
  706. echo "\">";
  707. echo twig_escape_filter($this->env, $this->getContext($context, "category"), "html", null, true);
  708. echo "</span>
  709. ";
  710. }
  711. $_parent = $context['_parent'];
  712. unset($context['_seq'], $context['_iterated'], $context['category'], $context['color'], $context['_parent'], $context['loop']);
  713. $context = array_intersect_key($context, $_parent) + $_parent;
  714. // line 491
  715. echo " </div>
  716. <canvas width=\"680\" height=\"\" id=\"";
  717. // line 492
  718. echo twig_escape_filter($this->env, $this->getContext($context, "id"), "html", null, true);
  719. echo "\" class=\"timeline\"></canvas>
  720. </div>
  721. ";
  722. } catch (Exception $e) {
  723. ob_end_clean();
  724. throw $e;
  725. }
  726. return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  727. }
  728. public function getTemplateName()
  729. {
  730. return "WebProfilerBundle:Collector:time.html.twig";
  731. }
  732. public function isTraitable()
  733. {
  734. return false;
  735. }
  736. public function getDebugInfo()
  737. {
  738. return array ( 810 => 492, 807 => 491, 796 => 489, 792 => 488, 788 => 486, 775 => 485, 749 => 479, 746 => 478, 727 => 476, 706 => 473, 702 => 472, 698 => 471, 694 => 470, 690 => 469, 686 => 468, 682 => 467, 679 => 466, 677 => 465, 660 => 464, 634 => 456, 625 => 453, 620 => 451, 606 => 449, 601 => 446, 567 => 414, 532 => 410, 527 => 408, 522 => 406, 202 => 94, 403 => 136, 401 => 135, 391 => 133, 382 => 131, 356 => 122, 347 => 119, 234 => 90, 389 => 160, 380 => 158, 363 => 153, 361 => 152, 358 => 151, 345 => 147, 340 => 145, 331 => 140, 326 => 138, 307 => 128, 288 => 118, 281 => 98, 259 => 103, 255 => 101, 253 => 100, 248 => 97, 213 => 78, 197 => 69, 175 => 58, 191 => 67, 185 => 75, 113 => 48, 104 => 31, 367 => 155, 353 => 121, 306 => 286, 232 => 89, 161 => 58, 184 => 63, 170 => 84, 150 => 71, 84 => 40, 65 => 11, 292 => 156, 287 => 153, 265 => 105, 257 => 141, 251 => 138, 233 => 131, 186 => 72, 167 => 71, 153 => 77, 148 => 67, 126 => 83, 195 => 89, 146 => 64, 58 => 25, 757 => 345, 751 => 341, 742 => 339, 738 => 338, 734 => 337, 728 => 334, 724 => 333, 710 => 475, 703 => 321, 696 => 317, 674 => 304, 667 => 300, 659 => 295, 645 => 290, 639 => 287, 635 => 286, 630 => 284, 566 => 222, 559 => 220, 553 => 217, 548 => 215, 543 => 214, 537 => 212, 531 => 210, 529 => 409, 525 => 208, 517 => 404, 512 => 204, 506 => 200, 501 => 198, 496 => 197, 490 => 195, 484 => 193, 482 => 192, 470 => 190, 459 => 183, 443 => 178, 412 => 166, 396 => 161, 390 => 159, 388 => 158, 329 => 139, 324 => 112, 274 => 96, 260 => 142, 256 => 103, 244 => 128, 222 => 83, 216 => 79, 206 => 87, 200 => 117, 127 => 35, 100 => 46, 350 => 120, 342 => 189, 284 => 112, 271 => 136, 267 => 135, 228 => 128, 215 => 104, 211 => 88, 178 => 59, 165 => 83, 20 => 1, 809 => 338, 802 => 334, 794 => 331, 786 => 328, 778 => 325, 770 => 322, 762 => 347, 754 => 316, 745 => 310, 740 => 308, 723 => 293, 717 => 329, 711 => 291, 708 => 290, 695 => 284, 689 => 313, 681 => 308, 673 => 279, 664 => 277, 661 => 276, 658 => 275, 655 => 294, 651 => 272, 649 => 462, 646 => 270, 642 => 268, 640 => 267, 636 => 266, 631 => 265, 629 => 454, 626 => 263, 622 => 452, 619 => 260, 603 => 254, 597 => 251, 589 => 250, 581 => 249, 572 => 247, 569 => 246, 564 => 245, 560 => 243, 557 => 242, 554 => 241, 551 => 240, 549 => 411, 546 => 238, 530 => 232, 524 => 229, 516 => 228, 499 => 225, 491 => 223, 488 => 222, 477 => 214, 473 => 213, 463 => 212, 454 => 181, 451 => 209, 447 => 207, 441 => 205, 438 => 204, 434 => 202, 411 => 194, 405 => 191, 397 => 190, 383 => 185, 378 => 157, 371 => 127, 335 => 169, 318 => 164, 302 => 125, 293 => 107, 377 => 129, 354 => 192, 338 => 116, 330 => 183, 313 => 110, 308 => 109, 262 => 93, 242 => 116, 237 => 91, 231 => 96, 225 => 115, 223 => 114, 198 => 107, 194 => 68, 192 => 82, 155 => 55, 134 => 39, 129 => 63, 124 => 57, 110 => 22, 508 => 227, 505 => 250, 493 => 241, 487 => 238, 478 => 191, 468 => 223, 465 => 187, 456 => 218, 446 => 216, 436 => 214, 426 => 212, 416 => 210, 406 => 208, 404 => 207, 399 => 204, 392 => 202, 376 => 156, 370 => 198, 349 => 144, 344 => 180, 339 => 179, 333 => 115, 327 => 175, 325 => 166, 321 => 135, 317 => 134, 311 => 162, 303 => 165, 296 => 121, 275 => 154, 249 => 92, 212 => 254, 210 => 77, 205 => 138, 23 => 1, 70 => 15, 449 => 180, 431 => 174, 418 => 170, 414 => 142, 394 => 134, 386 => 159, 372 => 115, 364 => 113, 359 => 123, 351 => 109, 346 => 190, 343 => 146, 334 => 141, 328 => 113, 323 => 80, 315 => 111, 304 => 67, 297 => 158, 290 => 119, 286 => 58, 282 => 57, 279 => 110, 276 => 111, 250 => 102, 207 => 76, 190 => 92, 188 => 90, 174 => 74, 152 => 54, 137 => 65, 118 => 49, 114 => 36, 97 => 41, 90 => 42, 81 => 41, 76 => 34, 180 => 70, 172 => 68, 77 => 34, 53 => 15, 34 => 6, 480 => 162, 474 => 161, 469 => 158, 461 => 155, 457 => 153, 453 => 151, 444 => 206, 440 => 148, 437 => 176, 435 => 175, 430 => 201, 427 => 200, 423 => 173, 413 => 141, 409 => 132, 407 => 138, 402 => 163, 398 => 129, 393 => 126, 387 => 187, 384 => 157, 381 => 120, 379 => 119, 374 => 128, 368 => 126, 365 => 125, 362 => 124, 360 => 147, 355 => 150, 341 => 117, 337 => 140, 322 => 165, 314 => 99, 312 => 130, 309 => 129, 305 => 108, 298 => 164, 294 => 90, 285 => 100, 283 => 115, 278 => 86, 268 => 107, 264 => 84, 258 => 126, 252 => 140, 247 => 121, 241 => 93, 229 => 87, 220 => 70, 214 => 123, 177 => 69, 169 => 75, 140 => 53, 132 => 51, 128 => 42, 107 => 56, 61 => 15, 273 => 96, 269 => 107, 254 => 198, 243 => 88, 240 => 14, 238 => 125, 235 => 89, 230 => 11, 227 => 86, 224 => 127, 221 => 80, 219 => 125, 217 => 75, 208 => 76, 204 => 75, 179 => 69, 159 => 57, 143 => 69, 135 => 46, 119 => 58, 102 => 24, 71 => 23, 67 => 14, 63 => 21, 59 => 22, 93 => 38, 88 => 24, 78 => 19, 94 => 21, 89 => 30, 85 => 23, 75 => 18, 68 => 30, 56 => 11, 27 => 3, 201 => 74, 196 => 92, 183 => 71, 171 => 73, 166 => 54, 163 => 82, 158 => 80, 156 => 71, 151 => 63, 142 => 64, 138 => 47, 136 => 71, 121 => 50, 117 => 37, 105 => 25, 91 => 25, 62 => 27, 49 => 11, 87 => 41, 46 => 10, 44 => 20, 25 => 35, 21 => 2, 31 => 4, 38 => 18, 26 => 3, 28 => 3, 24 => 3, 19 => 1, 79 => 18, 72 => 17, 69 => 26, 47 => 21, 40 => 8, 37 => 7, 22 => 2, 246 => 136, 157 => 56, 145 => 74, 139 => 63, 131 => 61, 123 => 61, 120 => 38, 115 => 58, 111 => 47, 108 => 33, 101 => 30, 98 => 45, 96 => 37, 83 => 33, 74 => 27, 66 => 25, 55 => 24, 52 => 12, 50 => 22, 43 => 12, 41 => 19, 35 => 6, 32 => 6, 29 => 3, 209 => 161, 203 => 73, 199 => 93, 193 => 95, 189 => 66, 187 => 92, 182 => 87, 176 => 86, 173 => 85, 168 => 48, 164 => 70, 162 => 74, 154 => 61, 149 => 68, 147 => 75, 144 => 42, 141 => 73, 133 => 45, 130 => 36, 125 => 41, 122 => 43, 116 => 57, 112 => 58, 109 => 52, 106 => 51, 103 => 50, 99 => 23, 95 => 27, 92 => 43, 86 => 51, 82 => 21, 80 => 32, 73 => 33, 64 => 23, 60 => 12, 57 => 20, 54 => 19, 51 => 37, 48 => 16, 45 => 8, 42 => 7, 39 => 6, 36 => 5, 33 => 4, 30 => 5,);
  739. }
  740. }