MongoDB
class MongoDB extends AbstractStorage
Class MongoDB Storage implementation using MongoDB.
Methods
__construct(string $host, string $database = 'phppromdb', string $collection = 'measurements', array $options = array(), array $driverOptions = array())
MongoDB constructor.
addAvailableMetric(string $metric, string $label, string $help, string $type, string $defaultValue)
Adds a metric to the available ones.
from AbstractStorage
void
storeMeasurement(string $metric, string $key, float $value)
Stores a measurement.
void
incrementMeasurement(string $metric, string $key)
Increments a measurement, starting with 1 if it doesn't exist yet.
array
getMeasurements(string $metric, array $keys, string $defaultValue = 'Nan')
Gets all measurements.
Details
at line line 53
__construct(string $host, string $database = 'phppromdb', string $collection = 'measurements', array $options = array(), array $driverOptions = array())
MongoDB 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 63
void
storeMeasurement(string $metric, string $key, float $value)
Stores a measurement.
at line line 75
void
incrementMeasurement(string $metric, string $key)
Increments a measurement, starting with 1 if it doesn't exist yet.
at line line 91
array
getMeasurements(string $metric, array $keys, string $defaultValue = 'Nan')
Gets all measurements.