Persistent Raw Data; Database Schema - Safran WR-ZEN Series User Manual

Hide thumbs Also See for WR-ZEN Series:
Table of Contents

Advertisement

For the sake of simplicity, this section will use the ppsi service as example, but
every example applies to any other service as they share the same structure. For
a complete list of parameters with statistics and persistent storage enabled see
"List of Parameters with Statistics Enabled" on
7.6.1

Persistent Raw Data

Raw data from services is stored in a single SQLite3 database. The datafiles are
stored in the home of the root user, located at /root/.db/metrics.db. When it
comes to the database schema, each service creates two different tables. The
first one maps parameters to IDs, while the second one contains the actual data.
The number of rows in the data table depends on the number of parameters with
statistics activated.
The aforementioned pair of tables are prefixed by the service name that owns
them and suffixed by _info and _raw. So, for instance, for the ppsi service, the
tables are called ppsi_info and ppsi_data.
The following sections describe the schema of the tables, and how to access
them.
7.6.1.1

Database Schema

As mentioned above, each service creates its _ info and _ raw. For ppsi, the
schema could be:
Column names of the _raw table correspond with the data of the METRIC_ID
column stored in the _info table.
For this particular ppsi example:
CHAPTER
7
WR-ZEN Series User Manual Rev. v5.1
7.6  Service Persistent Raw Data and Runtime Statistics
sqlite> .schema
CREATE TABLE ppsi_info (
METRIC_ID TEXT PRIMARY KEY,
METRIC_NAME TEXT NOT NULL,
PARAM_NAME TEXT NOT NULL,
METRIC_TYPE TEXT NOT NULL
);
REATE TABLE ppsi_raw (
TIMESTAMP INTEGER PRIMARY KEY,
M0000 TEXT, M0001 REAL, M0002 REAL, M0003 REAL, M0004 REAL,
M0005 TEXT, M0006 REAL, M0007 REAL, M0008 REAL, M0009 REAL,
M0010 TEXT, M0011 REAL, M0012 REAL, M0013 REAL, M0014 REAL
);
page 199.
157

Advertisement

Table of Contents
loading

Table of Contents