diff options
author | Valery Piashchynski <[email protected]> | 2020-11-17 16:25:35 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-11-17 16:25:35 +0300 |
commit | 3cbdd3d3e44b3b4e72565d666391e3b732950774 (patch) | |
tree | 7c60fafe1c33076631e39fe26be187c9ca359a3e /src/MetricsInterface.php | |
parent | a57d064407e2ed7f35dd591101b5d421c64605e1 (diff) |
Get http working with new container
Diffstat (limited to 'src/MetricsInterface.php')
-rw-r--r-- | src/MetricsInterface.php | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/MetricsInterface.php b/src/MetricsInterface.php new file mode 100644 index 00000000..ec2009b0 --- /dev/null +++ b/src/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 = []); +} |