summaryrefslogtreecommitdiff
path: root/src/Metrics/MetricsInterface.php
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2020-10-26 21:02:56 +0300
committerWolfy-J <[email protected]>2020-10-26 21:02:56 +0300
commit2d3349eee632e7357ed1eb6905444194a28a4ec0 (patch)
tree74e15277ffe8c11a24e3d3b1a30edfd9597ef984 /src/Metrics/MetricsInterface.php
parent91cf918b30938129609323ded53e190385e019a6 (diff)
- working on new cmd and logger setup
Diffstat (limited to 'src/Metrics/MetricsInterface.php')
-rw-r--r--src/Metrics/MetricsInterface.php64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/Metrics/MetricsInterface.php b/src/Metrics/MetricsInterface.php
new file mode 100644
index 00000000..ec2009b0
--- /dev/null
+++ b/src/Metrics/MetricsInterface.php
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * Spiral Framework.
+ *
+ * @license MIT
+ * @author Anton Titov (Wolfy-J)
+ */
+declare(strict_types=1);
+
+namespace Spiral\RoadRunner;
+
+use Spiral\RoadRunner\Exception\MetricException;
+
+interface MetricsInterface
+{
+ /**
+ * Add collector value. Fallback to appropriate method of related collector.
+ *
+ * @param string $collector
+ * @param float $value
+ * @param mixed[] $labels
+ *
+ * @throws MetricException
+ * @return void
+ */
+ public function add(string $collector, float $value, array $labels = []);
+
+ /**
+ * Subtract the collector value, only for gauge collector.
+ *
+ * @param string $collector
+ * @param float $value
+ * @param mixed[] $labels
+ *
+ * @throws MetricException
+ * @return void
+ */
+ public function sub(string $collector, float $value, array $labels = []);
+
+ /**
+ * Observe collector value, only for histogram and summary collectors.
+ *
+ * @param string $collector
+ * @param float $value
+ * @param mixed[] $labels
+ *
+ * @throws MetricException
+ * @return void
+ */
+ public function observe(string $collector, float $value, array $labels = []);
+
+ /**
+ * Set collector value, only for gauge collector.
+ *
+ * @param string $collector
+ * @param float $value
+ * @param mixed[] $labels
+ *
+ * @throws MetricException
+ * @return void
+ */
+ public function set(string $collector, float $value, array $labels = []);
+}