1 | <?php |
||
17 | class Analytics extends Api |
||
18 | { |
||
19 | /** |
||
20 | * Dashboard (permission needed: #analytics:read) |
||
21 | * The dashboard view provides both totals and timeseries data for the given zone and time period across the entire CloudFlare network. |
||
22 | * |
||
23 | * @param string $zone_identifier |
||
24 | * @param string|int|null $since The (inclusive) beginning of the requested time frame. This value can be a negative integer representing the number of minutes in the past relative to time the request is made, |
||
25 | * or can be an absolute timestamp that conforms to RFC 3339. At this point in time, it cannot exceed a time in the past greater than one year. |
||
26 | * @param string|int|null $until The (exclusive) end of the requested time frame. This value can be a negative integer representing the number of minutes in the past relative to time the request is made, |
||
27 | * or can be an absolute timestamp that conforms to RFC 3339. If omitted, the time of the request is used. |
||
28 | * @param bool $continuous When set to true, the range returned by the response acts like a sliding window to provide a contiguous time-window. |
||
29 | * Analytics data is processed and aggregated asynchronously and can sometimes lead to recent data points being incomplete if this value is set to false. |
||
30 | * If a start date provided is earlier than a date for which data is available, the API will return 0's for those dates until the first available date with data |
||
31 | */ |
||
32 | public function dashboard($zone_identifier, $since = null, $until = null, $continuous = null) |
||
42 | |||
43 | /** |
||
44 | * Analytics by Co-locations (permission needed: #analytics:read) |
||
45 | * This view provides a breakdown of analytics data by datacenter. Note: This is available to Enterprise customers only. |
||
46 | * |
||
47 | * @param string $zone_identifier |
||
48 | * @param string|int|null $since The (inclusive) beginning of the requested time frame. This value can be a negative integer representing the number of minutes in the past relative to time the request is made, |
||
49 | * or can be an absolute timestamp that conforms to RFC 3339. At this point in time, it cannot exceed a time in the past greater than one year. |
||
50 | * @param string|int|null $until The (exclusive) end of the requested time frame. This value can be a negative integer representing the number of minutes in the past relative to time the request is made, |
||
51 | * or can be an absolute timestamp that conforms to RFC 3339. If omitted, the time of the request is used. |
||
52 | * @param bool $continuous When set to true, the range returned by the response acts like a sliding window to provide a contiguous time-window. |
||
53 | * Analytics data is processed and aggregated asynchronously and can sometimes lead to recent data points being incomplete if this value is set to false. |
||
54 | * If a start date provided is earlier than a date for which data is available, the API will return 0's for those dates until the first available date with data |
||
55 | */ |
||
56 | public function colos($zone_identifier, $since = null, $until = null, $continuous = null) |
||
66 | } |
||
67 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.