A no-frills database and grapher for simple sequential logging.
The database, loosely termed, is a headerless binary file consisting of 12-byte time/value pairs: a float that stores a value logged on an occasion, and an int64 that records the time (milliseconds since epoch) of the occasion.
Note! This was among my first projects in PHP, so don't hold it against me.
Currently, opdb is made up of two components:
opdb_graph. The former is used to interact with the database file, and the latter to produce graphs of logged data.
PHP 7 with GD and CLI.
The following command-line command will log the value
50.2 into the file
$ opdb log thing.opdb 50.2
To get a raw printout of the contents of
$ opdb print thing.opdb 1. [Sat Jan 26 08:07:14 2019] 50.2
A PNG graph of
thing.opdb can be produced in this manner:
$ php opdb_graph.php -i thing.opdb -o thing.png -w 250 -h 150 -d 1
You can find a list of the command-line parameters accepted by
opdb_graph.php in that file.
Note! The grapher will always graph up to the most recent entry in the database file. You can select how many days back to start from, but not where to end.