laravel-prometheus-exporter/src/CollectorInterface.php
2017-07-27 11:11:02 +02:00

34 lines
853 B
PHP

<?php
namespace Superbalist\LaravelPrometheusExporter;
interface CollectorInterface
{
/**
* Return the name of the collector.
*
* @return string
*/
public function getName();
/**
* 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);
/**
* 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();
}