diff options
author | 2024-10-17 17:40:34 +0000 | |
---|---|---|
committer | 2024-10-24 16:36:10 +0000 | |
commit | 7f22db8fc1fcff100e6916d4e7b09149c8b6b6b1 (patch) | |
tree | fd4cb20a9cd67e11d2a2f2bfb6cc2f40f2cf54d5 /tools/edit_monitor/main.py | |
parent | ba64f31b5698b3c7440f1b6f4df1bfb202a208b0 (diff) |
Support --dry_run option in edit monitor
If --dry_run option is set, edit monitor runs without actually sending
the edit logs to clearcut
Test: atest edit_monitor_test
bug: 365617369
Change-Id: I793d9b0a2e16ffa70fe03d1d3f53d676a1d86cf3
Diffstat (limited to 'tools/edit_monitor/main.py')
-rw-r--r-- | tools/edit_monitor/main.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/edit_monitor/main.py b/tools/edit_monitor/main.py index 9086ac839a..6af421b1f3 100644 --- a/tools/edit_monitor/main.py +++ b/tools/edit_monitor/main.py @@ -42,6 +42,12 @@ def create_arg_parser(): ) parser.add_argument( + '--dry_run', + action='store_true', + help='Dry run the edit monitor. This starts the edit monitor process without actually send the edit logs to clearcut.', + ) + + parser.add_argument( '--force_cleanup', action='store_true', help=( @@ -76,11 +82,14 @@ def term_signal_handler(_signal_number, _frame): def main(argv: list[str]): args = create_arg_parser().parse_args(argv[1:]) + if args.dry_run: + logging.info('This is a dry run.') dm = daemon_manager.DaemonManager( binary_path=argv[0], daemon_target=edit_monitor.start, - daemon_args=(args.path,), + daemon_args=(args.path, args.dry_run), ) + if args.force_cleanup: dm.cleanup() |