[Perl] DAQ system for the FAPG.
perf index dashboard query timestamps
- index readings by probe and effective observation timestamp - index valid statuses by probe and effective observation timestamp - apply the repository PerlTidy profile to the recorder
roles/daq-recorder/bin/fapg-daq-mqtt-sqlite
@@ -129,6 +129,13 @@
129
129
130
130
$dbh->do(
131
131
q{
132
Added:
CREATE INDEX IF NOT EXISTS readings_probe_observed_idx
133
Added:
ON readings(probe, COALESCE(timestamp, received_at), id)
134
Added:
}
135
Added:
);
136
Added:
137
Added:
$dbh->do(
138
Added:
q{
132
139
CREATE INDEX IF NOT EXISTS readings_topic_idx
133
140
ON readings(topic)
134
141
}
@@ -164,6 +171,13 @@
164
171
165
172
$dbh->do(
166
173
q{
174
Added:
CREATE INDEX IF NOT EXISTS node_status_valid_probe_observed_idx
175
Added:
ON node_status(valid, probe, COALESCE(timestamp, received_at), id)
176
Added:
}
177
Added:
);
178
Added:
179
Added:
$dbh->do(
180
Added:
q{
167
181
CREATE INDEX IF NOT EXISTS node_status_topic_idx
168
182
ON node_status(topic)
169
183
}
@@ -187,7 +201,8 @@
187
201
$error = $@;
188
202
chomp $error;
189
203
$data = {};
190
Removed:
} elsif ( ref $data ne 'HASH' ) {
204
Added:
}
205
Added:
elsif ( ref $data ne 'HASH' ) {
191
206
$valid = 0;
192
207
$error = 'JSON payload is not an object';
193
208
$data = {};
@@ -248,7 +263,8 @@
248
263
? "$error; unsupported status: $status"
249
264
: "unsupported status: $status";
250
265
}
251
Removed:
} else {
266
Added:
}
267
Added:
else {
252
268
$valid = 0;
253
269
$error = defined $error ? "$error; missing status" : 'missing status';
254
270
}