---
title: "danog\\BetterPrometheus\\BetterGauge: A better prometheus gauge."
description: ""

---
# `danog\BetterPrometheus\BetterGauge`
[Back to index](../../index.md)

> Author: Daniil Gentili <daniil@daniil.it>  
  

A better prometheus gauge.  



## Properties
* `$storageAdapter`: `Prometheus\Storage\Adapter` Storage adapter
* `$namespace`: `string` Metric namespace
* `$name`: `string` Metric name
* `$help`: `string` Info about the metric
* `$labels`: `array<string, string>` Default labels, i.e. ['instance' => 'instance_1']

## Method list:
* [`addLabels(array $labels): static`](#addLabels)
* [`set((int|double) $value, array<string, string> $labels = []): void`](#set)
* [`incBy(int|float $value, array<string, string> $labels = []): void`](#incBy)
* [`inc(array<string, string> $labels = []): void`](#inc)
* [`dec(array<string, string> $labels = []): void`](#dec)
* [`decBy(int|float $value, array<string, string> $labels = []): void`](#decBy)
* [`__construct(\Prometheus\Storage\Adapter $storageAdapter, string $namespace, string $name, string $help, array $labels = [])`](#__construct)

## Methods:
### <a name="addLabels"></a> `addLabels(array $labels): static`




Parameters:

* `$labels`: `array`   



### <a name="set"></a> `set((int|double) $value, array<string, string> $labels = []): void`




Parameters:

* `$value`: `(int|double)` e.g. 123  
* `$labels`: `array<string, string>` e.g. ['status' => '201', 'opcode' => 'SOME_OP']  


#### See also: 
* `double`




### <a name="incBy"></a> `incBy(int|float $value, array<string, string> $labels = []): void`




Parameters:

* `$value`: `int|float`   
* `$labels`: `array<string, string>` e.g. ['status' => '201', 'opcode' => 'SOME_OP']  



### <a name="inc"></a> `inc(array<string, string> $labels = []): void`




Parameters:

* `$labels`: `array<string, string>` e.g. ['status' => '201', 'opcode' => 'SOME_OP']  



### <a name="dec"></a> `dec(array<string, string> $labels = []): void`




Parameters:

* `$labels`: `array<string, string>` e.g. ['status' => '201', 'opcode' => 'SOME_OP']  



### <a name="decBy"></a> `decBy(int|float $value, array<string, string> $labels = []): void`




Parameters:

* `$value`: `int|float`   
* `$labels`: `array<string, string>` e.g. ['status' => '201', 'opcode' => 'SOME_OP']  



### <a name="__construct"></a> `__construct(\Prometheus\Storage\Adapter $storageAdapter, string $namespace, string $name, string $help, array $labels = [])`

Constructor.


Parameters:

* `$storageAdapter`: `\Prometheus\Storage\Adapter`   
* `$namespace`: `string`   
* `$name`: `string`   
* `$help`: `string`   
* `$labels`: `array`   


#### See also: 
* `\Prometheus\Storage\Adapter`




---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
