for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Krenor\Prometheus\Metrics;
use Krenor\Prometheus\Contracts\Metric;
use Tightenco\Collect\Support\Collection;
use Krenor\Prometheus\Contracts\SamplesBuilder;
use Krenor\Prometheus\Contracts\Types\Incrementable;
use Krenor\Prometheus\Storage\Builders\CounterSamplesBuilder;
abstract class Counter extends Metric implements Incrementable
{
/**
* {@inheritdoc}
*/
final public function builder(Collection $items): SamplesBuilder
return new CounterSamplesBuilder($this, $items);
}
final public function type(): string
return 'counter';
public function increment(array $labels): self
return $this->incrementBy(1, $labels);
public function incrementBy(float $value, array $labels): self
static::$storage->increment($this, $value, $labels);
return $this;