@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | $stats = Webperf::$plugin->profileTarget->stats; |
| 154 | 154 | $request = Craft::$app->getRequest(); |
| 155 | - $pageLoad = (int)($stats['database']['duration'] |
|
| 155 | + $pageLoad = (int) ($stats['database']['duration'] |
|
| 156 | 156 | + $stats['twig']['duration'] |
| 157 | 157 | + $stats['other']['duration']); |
| 158 | 158 | // Allocate a new DataSample, and fill it in |
@@ -162,13 +162,13 @@ discard block |
||
| 162 | 162 | 'queryString' => $request->getQueryString(), |
| 163 | 163 | 'pageLoad' => $pageLoad, |
| 164 | 164 | 'craftTotalMs' => $pageLoad, |
| 165 | - 'craftDbMs' => (int)$stats['database']['duration'], |
|
| 166 | - 'craftDbCnt' => (int)$stats['database']['count'], |
|
| 167 | - 'craftTwigMs' => (int)$stats['twig']['duration'], |
|
| 168 | - 'craftTwigCnt' => (int)$stats['twig']['count'], |
|
| 169 | - 'craftOtherMs' => (int)$stats['other']['duration'], |
|
| 170 | - 'craftOtherCnt' => (int)$stats['other']['count'], |
|
| 171 | - 'craftTotalMemory' => (int)($stats['database']['memory'] |
|
| 165 | + 'craftDbMs' => (int) $stats['database']['duration'], |
|
| 166 | + 'craftDbCnt' => (int) $stats['database']['count'], |
|
| 167 | + 'craftTwigMs' => (int) $stats['twig']['duration'], |
|
| 168 | + 'craftTwigCnt' => (int) $stats['twig']['count'], |
|
| 169 | + 'craftOtherMs' => (int) $stats['other']['duration'], |
|
| 170 | + 'craftOtherCnt' => (int) $stats['other']['count'], |
|
| 171 | + 'craftTotalMemory' => (int) ($stats['database']['memory'] |
|
| 172 | 172 | + $stats['twig']['memory'] |
| 173 | 173 | + $stats['other']['memory']), |
| 174 | 174 | ]); |
@@ -92,8 +92,8 @@ |
||
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | $this->stats[$cat]['count']++; |
| 95 | - $this->stats[$cat]['duration'] += (float)$timing['duration'] * 1000; |
|
| 96 | - $this->stats[$cat]['memory'] += (int)$timing['memoryDiff']; |
|
| 95 | + $this->stats[$cat]['duration'] += (float) $timing['duration'] * 1000; |
|
| 96 | + $this->stats[$cat]['memory'] += (int) $timing['memoryDiff']; |
|
| 97 | 97 | } |
| 98 | 98 | $this->stats['memory'] = memory_get_peak_usage(true); |
| 99 | 99 | if ($final) { |
@@ -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'); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | ->from(['{{%webperf_data_samples}}']) |
| 43 | 43 | ->where(['not', [$column => null]]) |
| 44 | 44 | ; |
| 45 | - if ((int)$siteId !== 0) { |
|
| 45 | + if ((int) $siteId !== 0) { |
|
| 46 | 46 | $query->andWhere(['siteId' => $siteId]); |
| 47 | 47 | } |
| 48 | 48 | return $query->count(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ['not', ['title' => '']], |
| 68 | 68 | ]) |
| 69 | 69 | ; |
| 70 | - if ((int)$siteId !== 0) { |
|
| 70 | + if ((int) $siteId !== 0) { |
|
| 71 | 71 | $query->andWhere(['siteId' => $siteId]); |
| 72 | 72 | } |
| 73 | 73 | $result = $query->one(); |