diff --git a/common/autoware_debug_tools/README.md b/common/autoware_debug_tools/README.md index a102e550..62d0119e 100644 --- a/common/autoware_debug_tools/README.md +++ b/common/autoware_debug_tools/README.md @@ -123,16 +123,16 @@ ros2 run autoware_debug_tools rosout_log_reconstructor ## Frequent Log Checker This script shows the frequent log from the `launch.log`. -In detail, the log which appears more than the threshold times during the duration will be shown. +In detail, the log which appears more than the threshold times during the duration will be list down. ### Usage ```bash -ros2 run autoware_debug_tools frequent_log_checker +ros2 run autoware_debug_tools frequent_log_checker ``` -The command options are +The command has following options. -- `-d`: duration to check the frequent log +- `-d`: duration to count the number of log - `-c`: threshold of the log count during the duration - `-f`: log format. Several log formats are pre-defined in the script. diff --git a/common/autoware_debug_tools/autoware_debug_tools/frequent_log_checker.py b/common/autoware_debug_tools/autoware_debug_tools/frequent_log_checker.py index 44db181d..487d3909 100755 --- a/common/autoware_debug_tools/autoware_debug_tools/frequent_log_checker.py +++ b/common/autoware_debug_tools/autoware_debug_tools/frequent_log_checker.py @@ -35,7 +35,7 @@ def is_in(self, log_list): return False -def check(log_file, duration_to_check, log_count_threshold, log_format): +def check(log_file, duration_to_count, log_count_threshold, log_format): recent_log_list = [] unique_frequent_log_list = [] @@ -70,7 +70,7 @@ def check(log_file, duration_to_check, log_count_threshold, log_format): # remove obsolete or already frequent log for log in recent_log_list[:]: duration = timestamp - log.timestamp - if duration_to_check < duration: + if duration_to_count < duration: recent_log_list.remove(log) # extract duplicated (= frequent) log @@ -95,7 +95,7 @@ def check(log_file, duration_to_check, log_count_threshold, log_format): def main(): parser = argparse.ArgumentParser(description="frequent log checker") parser.add_argument("log_file", help="launch log file") - parser.add_argument("-d", "--log-duration", default=1.0, help="duration to check log") + parser.add_argument("-d", "--log-duration", default=1.0, help="duration to count log") parser.add_argument("-c", "--log-count", default=2, help="log count threshold") parser.add_argument("-f", "--log-format", default="1", help="log format") args = parser.parse_args()