1 | <?php |
||
8 | class StatsdProfiler implements Profiler |
||
9 | { |
||
10 | /** |
||
11 | * StatsD instance. |
||
12 | * |
||
13 | * @var League\StatsD\Client |
||
14 | */ |
||
15 | private $statsd; |
||
16 | |||
17 | /** |
||
18 | * Initialize measurer with StatsD instance. |
||
19 | * |
||
20 | * @param League\StatsD\Client $statsd |
||
21 | */ |
||
22 | public function __construct(Statsd $statsd) |
||
26 | |||
27 | /** |
||
28 | * Increment a metric. |
||
29 | * |
||
30 | * @param string|array $metrics Metric(s) to increment |
||
31 | * @param int $delta Value to decrement the metric by |
||
32 | * @param int $sampleRate Sample rate of metric |
||
33 | * |
||
34 | * @return bool True if data transfer is successful |
||
35 | */ |
||
36 | public function increment($metrics, $delta = 1, $sampleRate = 1) |
||
40 | |||
41 | /** |
||
42 | * Decrement a metric. |
||
43 | * |
||
44 | * @param string|array $metrics Metric(s) to decrement |
||
45 | * @param int $delta Value to increment the metric by |
||
46 | * @param int $sampleRate Sample rate of metric |
||
47 | * |
||
48 | * @return bool True if data transfer is successful |
||
49 | */ |
||
50 | public function decrement($metrics, $delta = 1, $sampleRate = 1) |
||
54 | |||
55 | /** |
||
56 | * Timing. |
||
57 | * |
||
58 | * @param string $metric Metric to track |
||
59 | * @param float $time Time in milliseconds |
||
60 | * |
||
61 | * @return bool True if data transfer is successful |
||
62 | */ |
||
63 | public function timing($metric, $time) |
||
67 | |||
68 | /** |
||
69 | * Time a function. |
||
70 | * |
||
71 | * @param string $metric Metric to time |
||
72 | * @param callable $func Function to record |
||
73 | * |
||
74 | * @return bool True if data transfer is successful |
||
75 | */ |
||
76 | public function time($metric, $func) |
||
80 | |||
81 | /** |
||
82 | * Gauges. |
||
83 | * |
||
84 | * @param string $metric Metric to gauge |
||
85 | * @param int $value Set the value of the gauge |
||
86 | * |
||
87 | * @return bool True if data transfer is successful |
||
88 | */ |
||
89 | public function gauge($metric, $value) |
||
93 | |||
94 | /** |
||
95 | * Sets - count the number of unique values passed to a key. |
||
96 | * |
||
97 | * @param $metric |
||
98 | * @param mixed $value |
||
99 | * |
||
100 | * @return bool True if data transfer is successful |
||
101 | */ |
||
102 | public function set($metric, $value) |
||
106 | } |
||
107 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..