initial commit

This commit is contained in:
Matthew Goslett 2017-07-27 11:11:02 +02:00
commit bf1a4e1879
17 changed files with 822 additions and 0 deletions

View file

@ -0,0 +1,34 @@
<?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();
}