Repository navigation
Support Monitor Layout types + PostgreSQL Example - #616
Conversation
bba5a78 to
757dcfe
Compare
|
Hi. I am reviewing the code. It builds, runs, and produces the csv. The timestamp looks a bit odd, for instance, row 569215 looks like this 1704,7.0916666666666668e+00,Genrou,5281_1_genrou,omega,2.2408284627934353e-05 This effectively means that t = 7.09 something. Is this thing going to merge on t if I need to left join? Thank you. |
|
@tsybinae Thanks! Join on Let me know if you have any othr issues! |
|
This functionality is not specific to the csv task, so the merge can go ahead. There may be more precision related questions within a few month. |
tsybinae
left a comment
There was a problem hiding this comment.
Builds and runs cleanly.
superwhiskers
left a comment
There was a problem hiding this comment.
core idea seems like the right approach. just some comments on implementation of formatting that should be addressed before this goes further.
|
@nkoukpaizan @superwhiskers feedback greatly appreciated! the example I hope is much better. And hopfully the template parameter approach is cleaner, please LMK |
f81fbde to
f9037df
Compare
46e3661 to
0ccf09e
Compare
|
@nkoukpaizan @superwhiskers This should be ready for final approval/review! |
superwhiskers
left a comment
There was a problem hiding this comment.
if we're going to blanket reject special characters inside these, we should do it at the point of parsing them, not later on when we construct the writer.
pelesh
left a comment
There was a problem hiding this comment.
Good to merge provided comment by @superwhiskers is addressed. Reject malformed bus labels at the point of inputing the data.
a10aa5f to
19f1b6e
Compare
|
Ready |
Description
Adds an
output_layoutsolver option for monitor output. With"output_layout": "long", each row ofoutput_fileholds one variable at one sample instead of one column per variable, so results load straight into SQL tables no matter how many variables are monitored.Closes #597.
Wide output is unchanged, and printing is faster:
developPrint time only, 2000 monitors × 4 variables over 500 samples.
Proposed changes
VariableMonitorLayout(WIDE,LONG) toSinkSpec, set byoutput_layoutnext tooutput_filein the solver file. It defaults towide, andlongis not supported withreference_file.sample, t, class, id, variable, valuerather than thet, id, valuesketched in the issue:classandidare the device'sclassandidfrom the case file, since anidalone can repeat across classes.variablegets its own column, so queries can filter or group by variable without parsing names.sampleis needed for a unique key, since the samples just before and after an event share the samet.appendEntries), and the controller writes every format and layout from that list. This replaces the per-format virtuals inVariableMonitorBaseand the formatting code inVariableMonitor.Sink<FormatT, Layout>), resolved at compile time.static_assertinset()); every existing getter does.VariableMonitorController::addVariable.DynamicSimulation/PostgreSQLexample that runs an ACTIVSg2000 bus fault and loads the long output into PostgreSQL with Docker Compose or Podman.monitorsfor removal in a follow-up PR.Checklist
-Wall -Wpedantic -Wconversion -Wextra.Further comments
@pelesh Feedback on PR length/scope
@tsybinae Thank you for the suggestion and guidance.