summaryrefslogtreecommitdiff
path: root/plugins/database/README
blob: c1a38c14f63303ef05c0c9198427dc9920de0ee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Database plugin {#database_plugin}
Version: @PROJECT_VERSION@

This plugin logs properties in a sqlite database file.  It can also be used as a source to
play back previous logs to AMB.

To enable the Database plugin, run cmake and enable the database_plugin option:

cmake -Ddatabase_plugin=On ..

To use the Database plugin, add the following to the "sources" array in /etc/ambd/config:

~~~~~~~~~~~~~{.json}
{
  "name" : "Database",
  "path" : "@PLUGIN_INSTALL_PATH@/databasesinkplugin.so",
  "databaseFile" : "storage",
  "bufferLength" : "100",
  "properties" : "{ 'properties' : ['VehicleSpeed','EngineSpeed'] }",
  "startOnLoad" : "false",
  "playbackOnLoad" : "false",
  "playbackMultiplier" : "1",
  "frequency" : "1"
}
~~~~~~~~~~~~~

## Configuration Key Definitions:

"name"
name of plugin.

"path"
path to plugin on the filesystem.

"databaseFile"
path to log file

Default: "storage"

"bufferLength"
Number of logged items to keep in memory before flushing to the database file.
A higher number will reduce writes and improve performance.

Default: 100

"properties"
List of properties to log.

"startOnLoad"
Start logging when AMB starts.

Default: false

"playbackOnLoad"
Play back the specified log (see "databaseFile") when AMB starts.

Default: false

"playbackMultiplier"
Speed at which to play back the specified log.
1 = realtime
2 = 2x speed
etc.

Default: 1

"frequency"
Frequency in Hz in which the database will write contents.  Only the newest values
will be written.  Other values are discarded.  If bufferLength is not full,the
database will not be written to until it is.

Default: 1

## AMB Properties:

DatabaseFile
Type: string
File to be used to log or play back.

corresponds to configuration option "databaseFile".

DatabaseLogging
Type: bool
Access: read/write

Indicates whether logging to the database is occuring.  Set to true to turn on
logging.  Set to false to stop logging.  This property is mutually exclusive with
the DatabasePlayback property.  Setting this to true will turn off playback.

Default: false when configuration option "startOnLoad" is not set.

DatabasePlayback
Type: bool
Access: read/write

Indicates whether database playback is occuring.  Set to true to turn on playback.
Set to false to turn off playback. This property is mutually exclusive with the
DatabaseLogging property.  Setting this to true will turn off logging.

Default: false when configuration option "playbackOnLoad" is not set.


## AMB DBus Interfaces:

org.automotive.DataLogger

Properties:
LogFile - Corresponds to "DatabaseFile"
Logging - Corresponds to "DatabaseLogging"
Playback - Corresponds to "DatabasePlayback"

~~~~~~~~~~~~~{.idl}
interface Datalogger
{
 attribute DOMString LogFile;
 attribute boolean Logging;
 attribute boolean Playback;
}
~~~~~~~~~~~~~