|
farm-ng-core
|
Classes | |
| class | EventServiceRecorder |
| class | RecorderService |
Functions | |
| str | get_file_name_base () |
| def | service_command (_args) |
| def | client_start_command (_args) |
| def | client_stop_command (_args) |
| def | record_command (_args) |
Variables | |
| DEFAULT_TIMEZONE = timezone.utc | |
| parser = argparse.ArgumentParser() | |
| sub_parsers = parser.add_subparsers() | |
| service_parser = sub_parsers.add_parser("service") | |
| default | |
| func | |
| client_parser = sub_parsers.add_parser("start") | |
| record_parser = sub_parsers.add_parser("record") | |
| required | |
| True | |
| type | |
| args = parser.parse_args() | |
# run the event_service which starts a simple test publisher python -m farm_ng.core.event_service # run the event_recorder which subscribes to the test publisher and records the events to a file python -m farm_ng.core.event_service_recorder record --service-config=config.json --config-name=record_all foo # note that the config file has an EventServiceConfig with name "record_all" which subscribes to the test publisher # then try playing back log file: python -m farm_ng.core.events_file_reader playback foo.0000.bin # or try running the event_service_recorder in service mode: # start the service python -m farm_ng.core.event_service_recorder service --service-config config.json --service-name recorder # in a separate terminal, start recording python -m farm_ng.core.event_service_recorder start --service-config config.json --service-name recorder # then stop recording python -m farm_ng.core.event_service_recorder stop --service-config config.json --service-name recorder
| def core.event_service_recorder.client_start_command | ( | _args | ) |
| def core.event_service_recorder.client_stop_command | ( | _args | ) |
| str core.event_service_recorder.get_file_name_base | ( | ) |
Returns the base name of the file.
The base name is the current date and time, and the host name.
Returns:
str: the base name of the file.
Example:
>>> get_file_name_base()
'2021_08_31_15_54_00_000000_ubuntu'
| def core.event_service_recorder.record_command | ( | _args | ) |
| def core.event_service_recorder.service_command | ( | _args | ) |
| core.event_service_recorder.args = parser.parse_args() |
| core.event_service_recorder.client_parser = sub_parsers.add_parser("start") |
| core.event_service_recorder.default |
| core.event_service_recorder.DEFAULT_TIMEZONE = timezone.utc |
| core.event_service_recorder.func |
| core.event_service_recorder.parser = argparse.ArgumentParser() |
| core.event_service_recorder.record_parser = sub_parsers.add_parser("record") |
| core.event_service_recorder.required |
| core.event_service_recorder.service_parser = sub_parsers.add_parser("service") |
| core.event_service_recorder.sub_parsers = parser.add_subparsers() |
| core.event_service_recorder.True |
| core.event_service_recorder.type |