From 4aef63a238afc1ec15eeaa1a6970c9b111329c42 Mon Sep 17 00:00:00 2001 From: "Samueltoddwaite@gmail.com" Date: Thu, 27 Oct 2022 17:38:49 +0000 Subject: [PATCH] breakdownTimeline.php setup with templating --- www/breakdownTimeline.php | 402 +++++------------- .../views/pages/breakdownTimeline.blade.php | 184 ++++++++ 2 files changed, 289 insertions(+), 297 deletions(-) create mode 100644 www/resources/views/pages/breakdownTimeline.blade.php diff --git a/www/breakdownTimeline.php b/www/breakdownTimeline.php index 5c51109c04..ddad604228 100644 --- a/www/breakdownTimeline.php +++ b/www/breakdownTimeline.php @@ -1,307 +1,115 @@ - - - - <?php echo $page_title; ?> - WebPageTest Content Breakdown - - - - - - - 'Scripting', - 'v8.compile' => 'Scripting', - 'FunctionCall' => 'Scripting', - 'GCEvent' => 'Scripting', - 'TimerFire' => 'Scripting', - 'EventDispatch' => 'Scripting', - 'TimerInstall' => 'Scripting', - 'TimerRemove' => 'Scripting', - 'XHRLoad' => 'Scripting', - 'XHRReadyStateChange' => 'Scripting', - 'MinorGC' => 'Scripting', - 'MajorGC' => 'Scripting', - 'FireAnimationFrame' => 'Scripting', - 'ThreadState::completeSweep' => 'Scripting', - 'Heap::collectGarbage' => 'Scripting', - 'ThreadState::performIdleLazySweep' => 'Scripting', - - 'Layout' => 'Layout', - 'UpdateLayoutTree' => 'Layout', - 'RecalculateStyles' => 'Layout', - 'ParseAuthorStyleSheet' => 'Layout', - 'ScheduleStyleRecalculation' => 'Layout', - 'InvalidateLayout' => 'Layout', - - 'Paint' => 'Painting', - 'DecodeImage' => 'Painting', - 'Decode Image' => 'Painting', - 'ResizeImage' => 'Painting', - 'CompositeLayers' => 'Painting', - 'Rasterize' => 'Painting', - 'PaintImage' => 'Painting', - 'PaintSetup' => 'Painting', - 'ImageDecodeTask' => 'Painting', - 'GPUTask' => 'Painting', - 'SetLayerTreeId' => 'Painting', - 'layerId' => 'Painting', - 'UpdateLayer' => 'Painting', - 'UpdateLayerTree' => 'Painting', - 'Draw LazyPixelRef' => 'Painting', - 'Decode LazyPixelRef' => 'Painting', - - 'ParseHTML' => 'Loading', - 'ResourceReceivedData' => 'Loading', - 'ResourceReceiveResponse' => 'Loading', - 'ResourceSendRequest' => 'Loading', - 'ResourceFinish' => 'Loading', - 'CommitLoad' => 'Loading', - - 'Idle' => 'Idle'); - $groups = array('Scripting' => 0, 'Layout' => 0, 'Painting' => 0, 'Loading' => 0, 'Other' => 0, 'Idle' => 0); - $groupColors = array('Scripting' => '#f1c453', - 'Layout' => '#9a7ee6', - 'Painting' => '#71b363', - 'Loading' => '#70a2e3', - 'Other' => '#f16161', - 'Idle' => '#cbd1d9'); - if (!array_key_exists('Idle', $processing)) { - $processing['Idle'] = 0; - } - foreach ($processing as $type => $time) { - $group = 'Other'; - if (array_key_exists($type, $mapping)) { - $group = $mapping[$type]; - } - $groups[$group] += $time; - } - } - ?> - -
-
- -
- -
-

Main-thread Processing

-

Where the browser's main thread was busy, not including idle time waiting for resources view timeline)"; - ?>.

-
- - -
- -
-

Processing Breakdown

- - - -
-
-
-
-
-
-
-
-
-
- -

Timing Breakdown

- -

All of the main-thread activity including idle (waiting for resources usually) view timeline)"; - ?>.

- - -
-
-
-
-
-
-
-
-
-
-
- +include 'common.inc'; -
- -
- - - - - - - - 255 ? 255 : $r)); - $g = dechex($g < 0 ? 0 : ($g > 255 ? 255 : $g)); - $b = dechex($b < 0 ? 0 : ($b > 255 ? 255 : $b)); - - $color = (strlen($r) < 2 ? '0' : '') . $r; - $color .= (strlen($g) < 2 ? '0' : '') . $g; - $color .= (strlen($b) < 2 ? '0' : '') . $b; - return '#' . $color; } -?> +//endregion + +//region template +echo view('pages.breakdownTimeline', [ + 'test_results_view' => true, + 'body_class' => 'result', + 'results_header' => $results_header, + 'processing' => $processing, + 'mapping' => $mapping, + 'group' => $group, + 'groups' => $groups, + 'groupColors' => $groupColors, + 'timeline_url' => "/timeline/" . VER_TIMELINE . "timeline.php?test=$id&run=$run&cached=$cached" // Slight testing problem with this on my docker image +]); +//endregion +?> \ No newline at end of file diff --git a/www/resources/views/pages/breakdownTimeline.blade.php b/www/resources/views/pages/breakdownTimeline.blade.php new file mode 100644 index 0000000000..55be914d76 --- /dev/null +++ b/www/resources/views/pages/breakdownTimeline.blade.php @@ -0,0 +1,184 @@ +@extends('default') + +@section('content') + + +
+
+
+
+

Main-thread Processing

+

Where the browser's main thread was busy, not including idle time waiting for resources + view timeline + . +

+
+
+
+

Processing Breakdown

+
+
+
+
+
+
+
+
+
+
+

Timing Breakdown

+

All of the main-thread activity including idle (waiting for resources usually) + view timeline +

+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + +@endsection \ No newline at end of file