opened
jordiandreu
username_0
Implements a mechanism to register a custom-user generic data recorder. The mechanism enables the possibility to register one or more custom data recorders. The recorders get configured by setting the sardana environment variable DataRecorder with one or more recorder class names.

Documentation about the implementation and configuration of a custom data recorder still missing.
[WIP] Generic data recorder
issue
created
reszelaz
username_1
Thanks @username_0 and @username_2 for working on this PR!
Just a comment on the documentation, there is https://github.com/sardana-org/sardana/pull/1457 which moves around some documentation related to the recorders. It would be nice to get that one integrated first so you work already on the reorganized document.

Also, there is the environment variables catalgue which would need to be updated with the new environment variable.

Regarding the implementation, do you foresee to parametrize somehow the initialization of the recorder class? Like for example the file recorders they receive the path to the file?
comment
created
tiagocoutinho
username_2
Yes, the idea was that each recorder would be responsible to figure out which parameters it needs to configure itself.
See example [here](https://github.com/ALBA-Synchrotron/sardana-streams/blob/f9c917f14bf475896c64f65a9ddc09e14390af76/sardana_streams/recorder/recorder.py#L7)
comment
created
reszelaz
username_1
Perfect! Thanks for the clarification!
comment
created
reszelaz
username_1
When reviewing issues I just found again #1274, which I think would benefit from this PR. @aureocarneiro, @username_3 how were you configuring the KafkaRecorder mentioned in https://github.com/sardana-org/sardana/issues/1274#issuecomment-579141745?
comment
created
13bscsaamjad
username_3
we have found that if you put multiple ScanFile and ScanRecorder, sardana uses them all sequentially. the catch is to have same number of ScanFile as ScanRecorder. we only tested with two though. embedding the example config.
```
senv ScanFile "['test1', 'test2']" 
senv ScanRecorder "['Scicatrecorder', 'H5Recorder']"
```
comment
created
teresanunez
username_4
Sorry if I have not understood what you mean, we use at DESY very very oft several recorders and the scanfile is the same
for all of them, only by the termination we know the format. For us it has to continue working like this.
comment
created
reszelaz
username_1
@username_4 there are no plans to change/remove activation of file recorders based on the file extension.
The `ScanRecorder` variable was added in the past to explicitelly activate a recorder regardless of the one that Sardana would assign based on the file extension. This PR is to propose a mechanism for activating data recorders which do not write to a file.

Thanks for sharing your configuration @username_3.
If I understands well the ScanFile value "test1" corresponding to the ScanRecorer value "Scicatrecorder" does not correspond to any real file - this recorder does not write to a file, right? So you used it as a placeholder so there is a match of elements in both lists?
comment
created
13bscsaamjad
username_3
@username_1 yes exactly.
comment