DBAL
class DBAL extends AbstractStorage
Class DBAL Storage implementation using Doctrine DBAL.
This way, MySQL and other databases are supported. The used SQL is kept very simple so the queries should work with most of the DBAL supported databases.
A MySQL example of the expected table:
CREATE TABLE phpprom
(
key
varchar(255) NOT NULL,
value
double NOT NULL,
PRIMARY KEY (key
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Methods
DBAL constructor.
Adds a metric to the available ones.
Stores a measurement.
Increments a measurement, starting with 1 if it doesn't exist yet.
Gets all measurements.
Details
at line line 119
__construct(Connection $connection, string $table = 'phpprom')
DBAL constructor.
in AbstractStorage at line line 48
addAvailableMetric(string $metric, string $label, string $help, string $type, string $defaultValue)
Adds a metric to the available ones.
in AbstractStorage at line line 64
array
getAvailableMetrics()
Gets all available metrics in an array.
at line line 130
void
storeMeasurement(string $metric, string $key, float $value)
Stores a measurement.
at line line 144
void
incrementMeasurement(string $metric, string $key)
Increments a measurement, starting with 1 if it doesn't exist yet.
at line line 162
array
getMeasurements(string $metric, array $keys, string $defaultValue = 'Nan')
Gets all measurements.