1
+ <?php
2
+ /**
3
+ * Spiral Framework.
4
+ *
5
+ * @license MIT
6
+ * @author Anton Titov (Wolfy-J)
7
+ */
8
+ declare (strict_types=1 );
9
+
10
+ namespace Spiral \RoadRunner ;
11
+
12
+ use Spiral \RoadRunner \Exception \MetricException ;
13
+
14
+ interface MetricsInterface
15
+ {
16
+ /**
17
+ * Add collector value. Fallback to appropriate method of related collector.
18
+ *
19
+ * @param string $collector
20
+ * @param float $value
21
+ * @param array $labels
22
+ *
23
+ * @throws MetricException
24
+ */
25
+ public function add (string $ collector , float $ value , array $ labels = []);
26
+
27
+ /**
28
+ * Subtract the collector value, only for gauge collector.
29
+ *
30
+ * @param string $collector
31
+ * @param float $value
32
+ * @param array $labels
33
+ *
34
+ * @throws MetricException
35
+ */
36
+ public function sub (string $ collector , float $ value , array $ labels = []);
37
+
38
+ /**
39
+ * Observe collector value, only for histogram and summary collectors.
40
+ *
41
+ * @param string $collector
42
+ * @param float $value
43
+ * @param array $labels
44
+ *
45
+ * @throws MetricException
46
+ */
47
+ public function observe (string $ collector , float $ value , array $ labels = []);
48
+
49
+ /**
50
+ * Set collector value, only for gauge collector.
51
+ *
52
+ * @param string $collector
53
+ * @param float $value
54
+ * @param array $labels
55
+ *
56
+ * @throws MetricException
57
+ */
58
+ public function set (string $ collector , float $ value , array $ labels = []);
59
+ }
0 commit comments