@@ -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) { |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | // See if there are too many database queries |
| 38 | 38 | if ($this->sample->craftTotalMs >= self::MAX_TOTAL_TIME) { |
| 39 | - $displayCraftTotalMs = ($this->sample->craftTotalMs / 1000) . 's'; |
|
| 39 | + $displayCraftTotalMs = ($this->sample->craftTotalMs / 1000).'s'; |
|
| 40 | 40 | $this->hasRecommendation = true; |
| 41 | 41 | $this->summary = Craft::t( |
| 42 | 42 | 'webperf', |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | // See if there are too many database queries |
| 38 | 38 | if ($this->sample->craftTwigMs >= self::MAX_TWIG_TIME) { |
| 39 | - $displayCraftTwigMs = ($this->sample->craftTwigMs / 1000) . 's'; |
|
| 39 | + $displayCraftTwigMs = ($this->sample->craftTwigMs / 1000).'s'; |
|
| 40 | 40 | $this->hasRecommendation = true; |
| 41 | 41 | $this->summary = Craft::t( |
| 42 | 42 | 'webperf', |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | // See if there are too many database queries |
| 38 | 38 | if ($this->sample->craftDbMs >= self::MAX_QUERY_TIME) { |
| 39 | - $displayCraftDbMs = ($this->sample->craftDbMs / 1000) . 's'; |
|
| 39 | + $displayCraftDbMs = ($this->sample->craftDbMs / 1000).'s'; |
|
| 40 | 40 | $this->hasRecommendation = true; |
| 41 | 41 | $this->summary = Craft::t( |
| 42 | 42 | 'webperf', |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | // See if there are too many database queries |
| 38 | 38 | if ($this->sample->domInteractive >= self::MAX_DOM_INTERACTIVE_TIME) { |
| 39 | - $displayDomInteractive = ($this->sample->domInteractive / 1000) . 's'; |
|
| 39 | + $displayDomInteractive = ($this->sample->domInteractive / 1000).'s'; |
|
| 40 | 40 | $this->hasRecommendation = true; |
| 41 | 41 | $this->summary = Craft::t( |
| 42 | 42 | 'webperf', |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | // See if there are too many database queries |
| 38 | 38 | if ($this->sample->firstByte >= self::MAX_TOTAL_TIME) { |
| 39 | - $displayFirstByte = ($this->sample->firstByte / 1000) . 's'; |
|
| 39 | + $displayFirstByte = ($this->sample->firstByte / 1000).'s'; |
|
| 40 | 40 | $this->hasRecommendation = true; |
| 41 | 41 | $this->summary = Craft::t( |
| 42 | 42 | 'webperf', |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | // See if there are too many database queries |
| 38 | 38 | if ($this->sample->firstContentfulPaint >= self::MAX_FIRST_CONTENTFUL_PAINT_TIME) { |
| 39 | - $displayFirstContentfulPaint = ($this->sample->firstContentfulPaint / 1000) . 's'; |
|
| 39 | + $displayFirstContentfulPaint = ($this->sample->firstContentfulPaint / 1000).'s'; |
|
| 40 | 40 | $this->hasRecommendation = true; |
| 41 | 41 | $this->summary = Craft::t( |
| 42 | 42 | 'webperf', |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | ]) |
| 83 | 83 | ->where(['between', 'dateCreated', $start, $end]) |
| 84 | 84 | ->andWhere(['not', [$column => null]]); |
| 85 | - if ((int)$siteId !== 0) { |
|
| 85 | + if ((int) $siteId !== 0) { |
|
| 86 | 86 | $query->andWhere(['siteId' => $siteId]); |
| 87 | 87 | } |
| 88 | 88 | if ($pageUrl !== '') { |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | ]) |
| 101 | 101 | ->where(['between', 'dateCreated', $start, $end]) |
| 102 | 102 | ->andWhere(['not', [$column => null]]); |
| 103 | - if ((int)$siteId !== 0) { |
|
| 103 | + if ((int) $siteId !== 0) { |
|
| 104 | 104 | $query->andWhere(['siteId' => $siteId]); |
| 105 | 105 | } |
| 106 | 106 | if ($pageUrl !== '') { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | // Massage the data |
| 112 | 112 | if ($stats) { |
| 113 | 113 | foreach ($stats as &$stat) { |
| 114 | - $stat['cnt'] = (int)$stat['cnt']; |
|
| 114 | + $stat['cnt'] = (int) $stat['cnt']; |
|
| 115 | 115 | } |
| 116 | 116 | $data = $stats[0]; |
| 117 | 117 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ]) |
| 158 | 158 | ->where(['between', 'dateCreated', $start, $end]) |
| 159 | 159 | ->andWhere(['not', [$column => null]]); |
| 160 | - if ((int)$siteId !== 0) { |
|
| 160 | + if ((int) $siteId !== 0) { |
|
| 161 | 161 | $query->andWhere(['siteId' => $siteId]); |
| 162 | 162 | } |
| 163 | 163 | $query |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | ]) |
| 179 | 179 | ->where(['between', 'dateCreated', $start, $end]) |
| 180 | 180 | ->andWhere(['not', [$column => null]]); |
| 181 | - if ((int)$siteId !== 0) { |
|
| 181 | + if ((int) $siteId !== 0) { |
|
| 182 | 182 | $query->andWhere(['siteId' => $siteId]); |
| 183 | 183 | } |
| 184 | 184 | $query |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | // Massage the data |
| 191 | 191 | if ($stats) { |
| 192 | 192 | foreach ($stats as &$stat) { |
| 193 | - $stat['cnt'] = (int)$stat['cnt']; |
|
| 193 | + $stat['cnt'] = (int) $stat['cnt']; |
|
| 194 | 194 | $stat['detailPageUrl'] = UrlHelper::cpUrl('webperf/page-detail', [ |
| 195 | 195 | 'pageUrl' => $stat['url'], |
| 196 | 196 | 'siteId' => $siteId, |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | ]) |
| 258 | 258 | ->where(['between', 'dateCreated', $start, $end]) |
| 259 | 259 | ; |
| 260 | - if ((int)$siteId !== 0) { |
|
| 260 | + if ((int) $siteId !== 0) { |
|
| 261 | 261 | $query->andWhere(['siteId' => $siteId]); |
| 262 | 262 | } |
| 263 | 263 | if ($pageUrl !== '') { |