added frequency option to database plugin. fixed up zone a bit.
[profile/ivi/automotive-message-broker.git] / plugins / database / README
1 Database plugin
2
3 This plugin logs properties in a sqlite database file.  It can also be used as a source to
4 play back previous logs to AMB.
5
6 To enable the Database plugin, run cmake and enable the database_plugin option:
7
8 cmake -Ddatabase_plugin=On ..
9
10 To use the Database plugin, add the following to the "sources" array in /etc/ambd/config:
11
12 {
13         "name" : "Database",
14         "path" : "/usr/lib/automotive-message-broker/databasesinkplugin.so",
15         "databaseFile" : "storage",
16         "bufferLength" : "100",
17         "properties" : "{ 'properties' : ['VehicleSpeed','EngineSpeed'] }",
18         "startOnLoad" : "false",
19         "playbackOnLoad" : "false",
20         "playbackMultiplier" : "1",
21         "frequency" : "1"
22 }
23
24 Configuration Key Definitions:
25
26 "name"
27 name of plugin.  This key is not used by the plugin at this moment.
28
29 "path"
30 path to plugin on the filesystem.
31
32 "databaseFile"
33 path to log file
34
35 Default: "storage"
36
37 "bufferLength"
38 Number of logged items to keep in memory before flushing to the database file.  
39 A higher number will reduce writes and improve performance.
40
41 Default: 100
42
43 "properties"
44 List of properties to log.
45
46 "startOnLoad"
47 Start logging when AMB starts.
48
49 Default: false
50
51 "playbackOnLoad"
52 Play back the specified log (see "databaseFile") when AMB starts.
53
54 Default: false
55
56 "playbackMultiplier"
57 Speed at which to play back the specified log.
58 1 = realtime
59 2 = 2x speed
60 etc.
61
62 Default: 1
63
64 "frequency"
65 Frequency in Hz in which the database will write contents.  Only the newest values
66 will be written.  Other values are discarded.  If bufferLength is not full,the 
67 database will not be written to until it is.
68
69 Default: 1
70
71 AMB Properties:
72
73 DatabaseFile
74 Type: string
75 File to be used to log or play back.  
76
77 corresponds to configuration option "databaseFile".
78
79 DatabaseLogging
80 Type: bool
81 Access: read/write
82
83 Indicates whether logging to the database is occuring.  Set to true to turn on
84 logging.  Set to false to stop logging.  This property is mutually exclusive with
85 the DatabasePlayback property.  Setting this to true will turn off playback.
86
87 Default: false when configuration option "startOnLoad" is not set.
88
89 DatabasePlayback
90 Type: bool
91 Access: read/write
92
93 Indicates whether database playback is occuring.  Set to true to turn on playback.
94 Set to false to turn off playback. This property is mutually exclusive with the 
95 DatabaseLogging property.  Setting this to true will turn off logging.
96
97 Default: false when configuration option "playbackOnLoad" is not set.