Passed
Push — v1 ( 83a102...fe1757 )
by Andrew
11:33 queued 04:25
created

src/config.php (1 issue)

1
<?php
2
/**
3
 * Webperf plugin for Craft CMS 3.x
4
 *
5
 * Monitor the performance of your webpages through real-world user timing data
6
 *
7
 * @link      https://nystudio107.com
8
 * @copyright Copyright (c) 2019 nystudio107
9
 */
10
11
/**
12
 * Webperf config.php
13
 *
14
 * This file exists only as a template for the Webperf settings.
15
 * It does nothing on its own.
16
 *
17
 * Don't edit this file, instead copy it to 'craft/config' as 'webperf.php'
18
 * and make your changes there to override default settings.
19
 *
20
 * Once copied to 'craft/config', this file will be multi-environment aware as
21
 * well, so you can have different settings groups for each environment, just as
22
 * you do for 'general.php'
23
 */
24
25
return [
26
27
    /**
28
     * @var string The public-facing name of the plugin
29
     */
30
    'pluginName' => 'Webperf',
31
32
    /**
33
     * @var bool Whether or not to include the beacon on the page
34
     */
35
    'includeBeacon' => true,
36
37
    /**
38
     * @var bool Whether or not to include the Craft profiling of pages
39
     */
40
    'includeCraftProfiling' => true,
41
42
    /**
43
     * @var bool If the site is static cached, turn this option on to prevent Webperf from generating a unique beacon token
44
     */
45
    'staticCachedSite' => false,
46
47
    /**
48
     * @var int The number of data samples to store
49
     */
50
    'dataSamplesStoredLimit' => 100000,
51
52
    /**
53
     * @var bool Whether the DataSamples should be trimmed after each new DataSample is added
54
     */
55
    'automaticallyTrimDataSamples' => true,
56
57
    /**
58
     * @var bool Whether outlier data samples that are 10x the mean should be deleted
59
     */
60
    'trimOutlierDataSamples' => true,
61
62
    /**
63
     * @var int The number of milliseconds required between recording of frontend beacon data samples
64
     */
65
    'rateLimitMs' => 500,
66
67
    /**
68
     * @var string API Key for WebPageTest.org
69
     */
70
    'webpageTestApiKey' => '',
71
72
    /**
73
     * @var array [Regular expressions](https://regexr.com/) to match URLs to exclude from tracking
74
     */
75
    'excludePatterns' => [
76
        0 => [
77
            'pattern' => '/webperf/.*',
78
        ],
79
        1 => [
80
            'pattern' => '/cpresources/.*',
81
        ],
82
    ],
83
84
    /**
85
     * @var bool Whether Craft `warning` messages should be recorded in addition to `error` messages
86
     */
87
    'includeCraftWarnings' => false,
88
89
    /**
90
     * @var int The number of error samples to store
91
     */
92
    'errorSamplesStoredLimit' => 1000,
93
94
    /**
95
     * @var bool Whether the ErrorSamples should be trimmed after each new ErrorSample is added
96
     */
97
    'automaticallyTrimErrorSamples' => true,
98
99
    /**
100
     * @var bool Whether to filter bot user agents from generating profile hits or not
101
     *           NOT visible in the GUI currently
102
     */
103
    'filterBotUserAgents' => true,
104
105
    /**
106
     * @var bool Whether the performance summary sidebar should be shown on entry, category, and product pages
107
     */
108
    'displaySidebar' => true,
109
110
    /**
111
     * @var string The dashboard 'fast' color for charts
112
     */
113
    'dashboardFastColor' => '#00C800',
114
115
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
116
     * @var string The dashboard 'average' color for charts
117
     */
118
    'dashboardAverageColor' => '#FFFF00',
119
120
    /**
121
     * @var string The dashboard 'slow' color for charts
122
     */
123
    'dashboardSlowColor' => '#C80000',
124
125
        // Threshold levels
126
    // =========================================================================
127
128
    /**
129
     * @var int Threshold in seconds for the dns metric, beyond which it will be considered slow
130
     */
131
    'dnsThreshold' => 0.5,
132
133
    /**
134
     * @var int Threshold in seconds for the connect metric, beyond which it will be considered slow
135
     */
136
    'connectThreshold' => 0.5,
137
138
    /**
139
     * @var int Threshold in seconds for the first byte metric, beyond which it will be considered slow
140
     */
141
    'firstByteThreshold' => 2.0,
142
143
    /**
144
     * @var int Threshold in seconds for the first paint metric, beyond which it will be considered slow
145
     */
146
    'firstPaintThreshold' => 5.0,
147
148
    /**
149
     * @var int Threshold in seconds for the first contentful paint metric, beyond which it will be considered slow
150
     */
151
    'firstContentfulPaintThreshold' => 5.0,
152
153
    /**
154
     * @var int Threshold in seconds for the DOM interactive metric, beyond which it will be considered slow
155
     */
156
    'domInteractiveThreshold' => 5.0,
157
158
    /**
159
     * @var int Threshold in seconds for the page load metric, beyond which it will be considered slow
160
     */
161
    'pageLoadThreshold' => 10.0,
162
163
    /**
164
     * @var int Threshold in seconds for the Craft execution metric, beyond which it will be considered slow
165
     */
166
    'craftTotalMsThreshold' => 2.0,
167
168
    /**
169
     * @var int Threshold in seconds for the database queries metric, beyond which it will be considered slow
170
     */
171
    'craftDbMsThreshold' => 2.0,
172
173
    /**
174
     * @var int Threshold in seconds for the Twig rendering metric, beyond which it will be considered slow
175
     */
176
    'craftTwigMsThreshold' => 2.0,
177
178
    /**
179
     * @var int Threshold in seconds for the Craft other metric, beyond which it will be considered slow
180
     */
181
    'craftOtherMsThreshold' => 2.0,
182
183
];
184