initial commit
This commit is contained in:
commit
bf1a4e1879
17 changed files with 822 additions and 0 deletions
34
src/CollectorInterface.php
Normal file
34
src/CollectorInterface.php
Normal 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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue