@@ -124,7 +124,7 @@ |
||
124 | 124 | // Compute the largest page load time |
125 | 125 | $maxTotalPageLoad = 0; |
126 | 126 | foreach ($stats as &$stat) { |
127 | - // Determine the stat type |
|
127 | + // Determine the stat type |
|
128 | 128 | if (!empty($stat['pageLoad']) && !empty($stat['craftTotalMs'])) { |
129 | 129 | $stat['type'] = 'both'; |
130 | 130 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | ->offset($offset) |
104 | 104 | ->where(['between', 'dateUpdated', $start, $end]) |
105 | 105 | ; |
106 | - if ((int)$siteId !== 0) { |
|
106 | + if ((int) $siteId !== 0) { |
|
107 | 107 | $query->andWhere(['siteId' => $siteId]); |
108 | 108 | } |
109 | 109 | if ($filter !== '') { |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | $index = 1; |
143 | 143 | foreach ($stats as &$stat) { |
144 | 144 | $stat['id'] = $index++; |
145 | - $stat['cnt'] = (int)$stat['cnt']; |
|
146 | - $stat['maxTotalPageLoad'] = (int)$maxTotalPageLoad; |
|
145 | + $stat['cnt'] = (int) $stat['cnt']; |
|
146 | + $stat['maxTotalPageLoad'] = (int) $maxTotalPageLoad; |
|
147 | 147 | // Decode any emojis in the title |
148 | 148 | if (!empty($stat['title'])) { |
149 | 149 | $stat['title'] = html_entity_decode($stat['title'], ENT_NOQUOTES, 'UTF-8'); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | ->where(['url' => $pageUrl]) |
241 | 241 | ->andWhere(['between', 'dateUpdated', $start, $end]) |
242 | 242 | ; |
243 | - if ((int)$siteId !== 0) { |
|
243 | + if ((int) $siteId !== 0) { |
|
244 | 244 | $query->andWhere(['siteId' => $siteId]); |
245 | 245 | } |
246 | 246 | if ($filter !== '') { |
@@ -272,12 +272,12 @@ discard block |
||
272 | 272 | $stat['type'] = 'frontend'; |
273 | 273 | } |
274 | 274 | if ($stat['pageLoad'] > $maxTotalPageLoad) { |
275 | - $maxTotalPageLoad = (int)$stat['pageLoad']; |
|
275 | + $maxTotalPageLoad = (int) $stat['pageLoad']; |
|
276 | 276 | } |
277 | 277 | } |
278 | 278 | // Massage the stats |
279 | 279 | foreach ($stats as &$stat) { |
280 | - $stat['maxTotalPageLoad'] = (int)$maxTotalPageLoad; |
|
280 | + $stat['maxTotalPageLoad'] = (int) $maxTotalPageLoad; |
|
281 | 281 | // Decode any emojis in the title |
282 | 282 | if (!empty($stat['title'])) { |
283 | 283 | $stat['title'] = html_entity_decode($stat['title'], ENT_NOQUOTES, 'UTF-8'); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | { |
142 | 142 | $stats = Webperf::$plugin->profileTarget->stats; |
143 | 143 | $request = Craft::$app->getRequest(); |
144 | - $pageLoad = (int)($stats['database']['duration'] |
|
144 | + $pageLoad = (int) ($stats['database']['duration'] |
|
145 | 145 | + $stats['twig']['duration'] |
146 | 146 | + $stats['other']['duration']); |
147 | 147 | // Allocate a new DataSample, and fill it in |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | 'queryString' => $request->getQueryString(), |
152 | 152 | 'pageLoad' => $pageLoad, |
153 | 153 | 'craftTotalMs' => $pageLoad, |
154 | - 'craftDbMs' => (int)$stats['database']['duration'], |
|
155 | - 'craftDbCnt' => (int)$stats['database']['count'], |
|
156 | - 'craftTwigMs' => (int)$stats['twig']['duration'], |
|
157 | - 'craftTwigCnt' => (int)$stats['twig']['count'], |
|
158 | - 'craftOtherMs' => (int)$stats['other']['duration'], |
|
159 | - 'craftOtherCnt' => (int)$stats['other']['count'], |
|
160 | - 'craftTotalMemory' => (int)($stats['database']['memory'] |
|
154 | + 'craftDbMs' => (int) $stats['database']['duration'], |
|
155 | + 'craftDbCnt' => (int) $stats['database']['count'], |
|
156 | + 'craftTwigMs' => (int) $stats['twig']['duration'], |
|
157 | + 'craftTwigCnt' => (int) $stats['twig']['count'], |
|
158 | + 'craftOtherMs' => (int) $stats['other']['duration'], |
|
159 | + 'craftOtherCnt' => (int) $stats['other']['count'], |
|
160 | + 'craftTotalMemory' => (int) ($stats['database']['memory'] |
|
161 | 161 | + $stats['twig']['memory'] |
162 | 162 | + $stats['other']['memory']), |
163 | 163 | ]); |