@@ -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) { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ]) |
80 | 80 | ->where(['between', 'dateCreated', $start, $end]) |
81 | 81 | ->andWhere(['not', [$column => null]]); |
82 | - if ((int)$siteId !== 0) { |
|
82 | + if ((int) $siteId !== 0) { |
|
83 | 83 | $query->andWhere(['siteId' => $siteId]); |
84 | 84 | } |
85 | 85 | if ($pageUrl !== '') { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ]) |
97 | 97 | ->where(['between', 'dateCreated', $start, $end]) |
98 | 98 | ->andWhere(['not', [$column => null]]); |
99 | - if ((int)$siteId !== 0) { |
|
99 | + if ((int) $siteId !== 0) { |
|
100 | 100 | $query->andWhere(['siteId' => $siteId]); |
101 | 101 | } |
102 | 102 | $stats = $query->all(); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | // Massage the data |
105 | 105 | if ($stats) { |
106 | 106 | foreach ($stats as &$stat) { |
107 | - $stat['cnt'] = (int)$stat['cnt']; |
|
107 | + $stat['cnt'] = (int) $stat['cnt']; |
|
108 | 108 | } |
109 | 109 | $data = $stats[0]; |
110 | 110 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | ]) |
151 | 151 | ->where(['between', 'dateCreated', $start, $end]) |
152 | 152 | ->andWhere(['not', [$column => null]]); |
153 | - if ((int)$siteId !== 0) { |
|
153 | + if ((int) $siteId !== 0) { |
|
154 | 154 | $query->andWhere(['siteId' => $siteId]); |
155 | 155 | } |
156 | 156 | $query |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | ]) |
172 | 172 | ->where(['between', 'dateCreated', $start, $end]) |
173 | 173 | ->andWhere(['not', [$column => null]]); |
174 | - if ((int)$siteId !== 0) { |
|
174 | + if ((int) $siteId !== 0) { |
|
175 | 175 | $query->andWhere(['siteId' => $siteId]); |
176 | 176 | } |
177 | 177 | $query |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | // Massage the data |
184 | 184 | if ($stats) { |
185 | 185 | foreach ($stats as &$stat) { |
186 | - $stat['cnt'] = (int)$stat['cnt']; |
|
186 | + $stat['cnt'] = (int) $stat['cnt']; |
|
187 | 187 | $stat['detailPageUrl'] = UrlHelper::cpUrl('webperf/page-detail', [ |
188 | 188 | 'pageUrl' => $stat['url'], |
189 | 189 | 'siteId' => $siteId, |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | ]) |
251 | 251 | ->where(['between', 'dateCreated', $start, $end]) |
252 | 252 | ; |
253 | - if ((int)$siteId !== 0) { |
|
253 | + if ((int) $siteId !== 0) { |
|
254 | 254 | $query->andWhere(['siteId' => $siteId]); |
255 | 255 | } |
256 | 256 | if ($pageUrl !== '') { |
@@ -107,7 +107,7 @@ |
||
107 | 107 | if (!empty($pageUrl)) { |
108 | 108 | $query->andWhere(['url' => $pageUrl]); |
109 | 109 | } |
110 | - if ((int)$siteId !== 0) { |
|
110 | + if ((int) $siteId !== 0) { |
|
111 | 111 | $query->andWhere(['siteId' => $siteId]); |
112 | 112 | } |
113 | 113 | $stats = $query->all(); |