scalopus
scalopus copied to clipboard
Scalopus record script improvements
Improvements for the record script contributed in https://github.com/iwanders/scalopus/pull/9:
- [ ]
-o filenamefor writing to a directly named file, detect.gzextension and zip if appropriate. It should still default tostdin. - [ ] Limit recording to number of events. (!) This might required some support from the backend.
- [ ] Add logging for
-v(v)that displays numbers of traces, etc. (!) Logging should probably be disabled if the script is writing tostdin.
@iwanders Any comments/corrections? This is based on your comment in https://github.com/iwanders/scalopus/pull/9#issuecomment-537010464
I think this captures it. We can do logging to stderr if we are writing the traces to stdout. That way we can still get info if piping it into a file.
We may need a 'streaming' mode in the native trace source to support limiting number of events and allow us to say, grep in the streaming output.
streaming | grep would be awesome!
Yeah, we should be able to do that by moving parts of this function to another function that yields a vector of jsons from the internal collection container (recorded_data_) in this class.
One problem we will have is that, at the moment we just can get away with one getMapping call at the end of the recording interval, which is gauranteed to include all mappings that were used in this interval. When we do streaming we need to retrieve the mappings at the beginning, but maybe also in between if we encounter tracepoints for which we don't have a mapping. This is obviously less than ideal. We need to think a bit whether we want to support encountering new tracepoints while streaming, or whether we expect all tracepoints to have already been encountered.