libgs.database.MonitorDb

class libgs.database.MonitorDb(db='sqlite:///libgs.db', binary_fmt='b64', disk_threshold=1000, disk_path='.', **kwargs)[source]

Monitor database interface class

The monitor database is a key/value type database that stores arbitrary monitoring values. Each key/value pair is additionally associated with the pass id for easy search.

It sets up a table with the following columns

key The name of the monitor point
value The monitor point value (JSON encoded)
pass_id The pass id associated with the current monitor entry
alert The alert level of the current monitor entry

Additionally each row is assigned a primary key and a timestamp

See Database for description of available arguments

Methods

put(pass_id, key, value[, alert]) Add key/value pair to database.

Inherited from base class

count_rows(table) Return the number of rows in a table
create_table(name, *columns, **kwargs) Set up the columns and add a unique key.
get([limit, keys, tstamps]) Get data from the database.
get_df(table[, where, limit, orderby, …]) Get data from communications database as a pandas.DataFrame object
get_file(fname) Grab a file resource and return the bytes or string (.bin or .txt)
put_df(table, df[, index, if_exists]) Add dataframe to database, appending metadata for when it was added