File tree 2 files changed +38
-7
lines changed
2 files changed +38
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
This is companion code for my Medium article.
4
4
5
+ ## Populate Test Data
6
+
7
+ ```
8
+ chmod +x run_sensors.sh
9
+ ./run_sensors.sh
10
+ ```
11
+
12
+ ## Query the Data
13
+
14
+ ```
15
+ python query_iot_data.py --help
16
+ usage: query_iot_data.py [--help] [-U <USERNAME>] [-P <PASSWORD>]
17
+ [-h <ADDRESS>] [-p <PORT>] [-n <NS>] [-s <SET>]
18
+ [--sensor <SENSOR-ID>] [-i]
19
+
20
+ optional arguments:
21
+ --help Displays this message.
22
+ -U <USERNAME>, --username <USERNAME>
23
+ Username to connect to database.
24
+ -P <PASSWORD>, --password <PASSWORD>
25
+ Password to connect to database.
26
+ -h <ADDRESS>, --host <ADDRESS>
27
+ Address of Aerospike server.
28
+ -p <PORT>, --port <PORT>
29
+ Port of the Aerospike server.
30
+ -n <NS>, --namespace <NS>
31
+ Port of the Aerospike server.
32
+ -s <SET>, --set <SET>
33
+ Port of the Aerospike server.
34
+ --sensor <SENSOR-ID> Sensor ID
35
+ -i, --interactive Interactive Mode
36
+ ```
Original file line number Diff line number Diff line change @@ -130,14 +130,13 @@ def print_sensor_data(rec, pp):
130
130
pp = pprint .PrettyPrinter (indent = 2 )
131
131
sensor_id = options .sensor_id
132
132
spacer = "=" * 30
133
- minute = 0
134
- key = (namespace , set , "sensor{}-12-31" .format (sensor_id ))
135
- print ("\n Retrieve sensor{} data for 8-11am, December 31st" .format (sensor_id ))
136
- if options .interactive :
137
- pause ()
138
- starts = 8 * 60
139
- ends = 11 * 60
140
133
try :
134
+ key = (namespace , set , "sensor{}-12-31" .format (sensor_id ))
135
+ print ("\n Retrieve sensor{} data for 8-11am, December 31st" .format (sensor_id ))
136
+ if options .interactive :
137
+ pause ()
138
+ starts = 8 * 60
139
+ ends = 11 * 60
141
140
ops = [
142
141
lh .list_get_by_value_range (
143
142
"t" ,
You can’t perform that action at this time.
0 commit comments