You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+71-81Lines changed: 71 additions & 81 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ RADAR-Backend provides an abstract layer to monitor and analyze streams of weara
12
12
The following are the prerequisites to run RADAR-Backend on your machine:
13
13
14
14
- Java 8
15
-
-[Confluent Platform 3.3.1](http://docs.confluent.io/3.3.1/installation.html) ( Running instances of Zookeeper, Kafka-broker(s), Schema-Registry and Kafka-REST-Proxy services ).
15
+
-[Confluent Platform 5.0.0](http://docs.confluent.io/5.0.0/installation.html) ( Running instances of Zookeeper, Kafka-broker(s), Schema-Registry and Kafka-REST-Proxy services ).
16
16
- SMTP server to send notifications from the monitors.
17
17
18
18
## Installation
@@ -49,24 +49,7 @@ The RADAR command-line has three subcommands: `stream`, `monitor` and `mock`. Th
49
49
### RADAR-Backend streams
50
50
51
51
1. In `radar.yml`, Specify in which `mode` you want to run the application. There are two alternatives: `standalone` and `high_performance`. The `standalone` starts one thread for each streams without checking the priority, whereas the `high_performance` starts as many thread as the related priority value
52
-
2. If `auto.create.topics.enable` is `false`in your Kafka `server.properties`, before starting you must create the topics manually. Create the following topics for Empatica E4 Streams
2. If `auto.create.topics.enable` is `false`in your Kafka `server.properties`, before starting you must create the topics manually. The stream server will print what topics to create.
70
53
3. Run `radar-backend` with configured `radar.yml` and `stream` argument
71
54
72
55
```shell
@@ -86,8 +69,13 @@ To get email notifications for Empatica E4 battery status, an email server witho
86
69
# level of battery you want to monitor
87
70
level: CRITICAL
88
71
# list of email addresses to be notified
89
-
email_address:
90
-
- notify-me@example.com
72
+
notify:
73
+
- project_id: s1
74
+
email_address:
75
+
- test@thehyve.nl
76
+
- project_id: s2
77
+
email_address:
78
+
- radar@thehyve.nl
91
79
# host name of your email server
92
80
email_host: localhost
93
81
# port of email server
@@ -104,11 +92,16 @@ To get email notifications for Empatica E4 battery status, an email server witho
104
92
disconnect_monitor:
105
93
# timeout in milliseconds -> 5 minutes
106
94
timeout: 300000
107
-
email_address:
108
-
- notify-me@example.com
109
95
email_host: localhost
110
-
email_port: 25
111
-
email_user: noreply@example.com
96
+
email_port: 25
97
+
email_user: no-reply@example.com
98
+
notify:
99
+
- project_id: s1
100
+
email_address:
101
+
- test@thehyve.nl
102
+
- project_id: s2
103
+
email_address:
104
+
- radar@thehyve.nl
112
105
# temperature readings are sent very regularly, but
113
106
# not too often.
114
107
topics:
@@ -118,35 +111,36 @@ To get email notifications for Empatica E4 battery status, an email server witho
118
111
3. For Source Statistics monitors, configure what source topics to monitor to output some basic output statistics (like last time seen)
119
112
120
113
```yaml
121
-
statistics_monitors:
122
-
# Human readable monitor name
123
-
- name: Empatica E4
124
-
# topics to aggregate. This can take any number of topics that may
125
-
# lead to slightly different statistics
126
-
topics:
127
-
- android_empatica_e4_blood_volume_pulse_1min
128
-
# Topic to write results to. This should follow the convention
129
-
# source_statistics_[provider]_[model] with produer and model as
130
-
# defined in RADAR-Schemas
131
-
output_topic: source_statistics_empatica_e4
132
-
# Maximum batch size to aggregate before sending results.
133
-
# Defaults to 1000.
134
-
max_batch_size: 500
135
-
# Flush timeout in milliseconds. If the batch size is not larger than
136
-
# max_batch_size for this amount of time, the current batch is
137
-
# forcefully flushed to the output topic.
138
-
# Defaults to 60000 = 1 minute.
139
-
flush_timeout: 15000
140
-
- name: Biovotion VSM1
141
-
topics:
142
-
- android_biovotion_vsm1_acceleration_1min
143
-
output_topic: source_statistics_biovotion_vsm1
144
-
- name: RADAR pRMT
145
-
topics:
146
-
- android_phone_acceleration_1min
147
-
- android_phone_bluetooth_devices
148
-
- android_phone_sms
149
-
output_topic: source_statistics_radar_prmt
114
+
stream:
115
+
statistics_monitors:
116
+
# Human readable monitor name
117
+
- name: Empatica E4
118
+
# topics to aggregate. This can take any number of topics that may
119
+
# lead to slightly different statistics
120
+
topics:
121
+
- android_empatica_e4_blood_volume_pulse_1min
122
+
# Topic to write results to. This should follow the convention
123
+
# source_statistics_[provider]_[model] with produer and model as
124
+
# defined in RADAR-Schemas
125
+
output_topic: source_statistics_empatica_e4
126
+
# Maximum batch size to aggregate before sending results.
127
+
# Defaults to 1000.
128
+
max_batch_size: 500
129
+
# Flush timeout in milliseconds. If the batch size is not larger than
130
+
# max_batch_size for this amount of time, the current batch is
131
+
# forcefully flushed to the output topic.
132
+
# Defaults to 60000 = 1 minute.
133
+
flush_timeout: 15000
134
+
- name: Biovotion VSM1
135
+
topics:
136
+
- android_biovotion_vsm1_acceleration_1min
137
+
output_topic: source_statistics_biovotion_vsm1
138
+
- name: RADAR pRMT
139
+
topics:
140
+
- android_phone_acceleration_1min
141
+
- android_phone_bluetooth_devices
142
+
- android_phone_sms
143
+
output_topic: source_statistics_radar_prmt
150
144
```
151
145
152
146
3. Run `radar-backend` with configured `radar.yml` and `monitor` argument
@@ -223,32 +217,30 @@ There are currently two APIs in RADAR-Backend: one for streaming data (RADAR-Str
223
217
224
218
RADAR-Stream is a layer on top of Kafka streams. Topics are processed by streams in two phases. First, a group of sensor streams aggregates data of sensors into predefined time windows (e.g., 10 seconds). Next, internal topics aggregate and transforms data that has already been processed by an earlier stream.
225
219
226
-
KafkaStreams currently communicates using master-slave model. The [MasterAggregator][1] defines the stream-master, while [AggregatorWorker][2] represents the stream-slave. The master-stream creates, starts and stops a list of stream-slaves registered with the corresponding master.
227
-
While the classical Kafka Consumer requires two implementations to support standalone and group executions, the AggregatorWorker provides both behaviors with one implementation.
220
+
KafkaStreams currently communicates using master-slave model. The [StreamMaster][1] defines the stream-master, while [StreamWorker][2] represents the stream-slave. The master-stream creates, starts and stops a list of stream-slaves registered with the corresponding master. While the classical Kafka Consumer requires two implementations to support standalone and group executions, the StreamWorker provides both behaviors with one implementation.
228
221
229
222
To extend the RADAR-Stream API, follow these steps (see the `org.radarcns.passive.empatica` package as an example):
230
223
231
-
- Create a stream group by overriding [GeneralStreamGroup][8]. Use its `createSensorStream` and `createStream` methods to create the stream definitions.
232
-
- For each topic, create a [AggregatorWorker][2].
233
-
- Define the [MasterAggregator][1]
224
+
- For each topic, create a [StreamWorker][2] or more conveniently extend [SensorStreamWorker][6].
225
+
- Add the stream topic to the `stream: streams: [{class: MyClass}]` configuration
226
+
234
227
235
228
#### Empatica E4
236
229
237
-
Currently, RADAR-Backend provides implementation to stream, monitor, store Empatica E4 topics data produced by RADAR-AndroidApplication.
238
-
[E4Worker][11] is the [MasterAggregator][1]. The stream group [E4Streams][14] defines the following sensor topics:
230
+
Currently, RADAR-Backend provides implementation to stream, monitor, store Empatica E4 topics data produced by RADAR-AndroidApplication. It defines the following streams:
239
231
240
-
- [E4Acceleration][15]: it aggregates data coming from accelerometer
241
-
- [E4BatteryLevel][16]: it aggregates battery level information
242
-
- [E4BloodVolumePulse][17]: it aggregates blood volume pulse data
243
-
- [E4ElectroDermalActivity][18]: it aggregates electrodermal activity informations
244
-
- [E4InterBeatInterval][20]: it aggregates inter-beat-interval data
245
-
- [E4Temperature][21]: it aggregates data coming form temperature sensor
232
+
- [E4Acceleration][15] aggregates data coming from accelerometer
233
+
- [E4BatteryLevel][16] aggregates battery level information
234
+
- [E4BloodVolumePulse][17] aggregates blood volume pulse data
- [E4InterBeatInterval][20] aggregates inter-beat-interval data
237
+
- [E4Temperature][21] aggregates data coming form temperature sensor
246
238
247
239
And one internal topic:
248
240
249
241
- [E4HeartRate][19]: starting from the inter-beat-interval, this aggregator computes the heart rate
250
242
251
-
[DeviceTimestampExtractor][10] implements a [TimestampExtractor](http://docs.confluent.io/3.1.2/streams/javadocs/index.html) such that: given in input a generic Apache Avro object, it extracts a field named `timeReceived`. [DeviceTimestampExtractor][10] works with the entire set of sensor schemas currently available.
243
+
[DeviceTimestampExtractor][10] implements a [TimestampExtractor](http://docs.confluent.io/5.0.0/streams/javadocs/index.html) such that: given in input a generic Apache Avro object, it extracts a field named `timeReceived`. [DeviceTimestampExtractor][10] works with the entire set of sensor schemas currently available.
252
244
253
245
#### Android Phone
254
246
@@ -269,19 +261,17 @@ Monitors can be used to evaluate the status of a single stream, for example whet
0 commit comments