forked from beatlabs/pyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCollectorInterface.php
More file actions
36 lines (31 loc) · 875 Bytes
/
CollectorInterface.php
File metadata and controls
36 lines (31 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types = 1);
namespace Beat\Pyr;
interface CollectorInterface
{
/**
* Return the name of the collector.
*
* @return string
*/
public function getName() : string;
/**
* Register all metrics associated with the collector.
*
* The metrics needs to be registered on the exporter object.
* eg:
* ```php
* $exporter->registerCounter('search_requests_total', 'The total number of search requests.');
* ```
*
* @param PrometheusExporter $exporter
*/
public function registerMetrics(PrometheusExporter $exporter) : void;
/**
* Collect metrics data, if need be, before exporting.
*
* As an example, this may be used to perform time consuming database queries and set the value of a counter
* or gauge.
*/
public function collect() : void;
}