Hs config: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
(The midas documentation has moved to https://midas.triumf.ca/docs/)
Tag: Replaced
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= MidasHistoryInterface =
The midas documentation has moved. See [https://midas.triumf.ca/docs/develop/features/storing_data/history/configuring/#data-destinations-history-drivers Data destinations (history drivers)] on the History: configuring page and [https://midas.triumf.ca/docs/develop/reference/reference/odb_keys/#loggerhistory /Logger/History] on the ODB keys page for the new documentation about configuring the history drivers.
 
New history configuration defines history channels similar to logger channels. Each history channel creates a history interface class (class MidasHistoryInterface). The mlogger can use this interface to write data into the history, mhttpd, mhist & co can use this interface to read data from the history. The interface is defined in history.h
 
* http://ladd00.triumf.ca/~daqweb/doc/midas/include/history.h
 
= History drivers =
 
The MIDAS distribution contains these drivers. More drivers can be easily added by the user (create history_xxx.cxx, add constructor to hs_get_histrory(), create the ODB /Logger/History/x/channel).
 
* "MIDAS" is the traditional MIDAS history, data is stored in the .hst binary files. (format is documented here [[mhformat]], see also [[mhist]] and [[mhdump]])
* "ODBC" stores history data in SQL database using the ODBC abstraction layer. MySQL is fully supported, Pgsql support is partially implemented, support for arbitrary ODBC driver is easy to add.
* "SQLITE" stores data in SQLITE3 .sqlite3 files. The SQL table format is similar to ODBC history, performance is similar, no database server required.
 
= ODB tree =
 
* /Logger/
** History/0/ --- history channel 0 (by default: "MIDAS")
*** Type --- driver type ("MIDAS")
*** Active --- y/n --- tells mlogger to write data into this channel
*** Debug --- debug level
*** PerVariableHistory --- tells mlogger to enable the Per-variable history logging mode
** History/1/ --- history channel 1 (by default: "ODBC")
*** Type --- driver type ("ODBC")
*** Active --- y/n
*** Debug --- debug level
*** Writer_ODBC_DSN --- ODBC Data Source Name for writing (used by mlogger)
*** Reader_ODBC_DSN --- ODBC Data Source Name for reading (used by mhttpd, mhist)
** History/2/ --- history channel 2 (by default: "SQLITE")
*** Type --- driver type ("SQLITE")
*** Active --- y/n
*** Debug --- debug level
*** Sqlite dir --- "/file/system/path" location of SQLITE database files
* /History/
** LoggerHistoryChannel --- "0" --- default history channel for mhttpd, mhist & co
 
Obsoleted ODB settings:
 
* /Logger/WriteFileHistory (y) --- use /Logger/History/0/Active (enable/disable writing of .hst history files)
* /Logger/ODBC* --- use /Logger/History/1/Writer_ODBC_DSN
* /History/PerVariableHistory --- use /Logger/History/0/PerVariableHistory (is ODBC or SQLITE history is enable, PerVariableHistory mode is forced to "y")
* /History/ODBC* --- use /Logger/History/1/Reader_ODBC_DSN
 
Other ODB settings:
 
* /Logger/History dir --- location of "MIDAS" history data files
* /History/Events, /History/Tags, /History/DisableTags --- private data storage by "MIDAS" history. (not used by ODBC and SQLITE history)
 
= Using the MIDAS history =
 
AAA
 
= Using the ODBC history =
 
* http://ladd00.triumf.ca/~daqweb/doc/midas-old/html/F_History_logging.html
 
= Using the SQLITE history =
 
No special configuration required. Create a directory for storage of sqlite history files, save it's path in ODB "/Logger/History/1/Sqlite dir", set "/Logger/History/1/Active" to "y", set "/History/LoggerHistoryChannel" to "1", restart mhttpd, restart mlogger. In the history data directory you should see files with name "mh_xxx.sqlite3" corresponding to your equipment and variable names.

Latest revision as of 22:00, 30 October 2026

The midas documentation has moved. See Data destinations (history drivers) on the History: configuring page and /Logger/History on the ODB keys page for the new documentation about configuring the history drivers.