Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
Signed-off-by: Takayuki Murooka <[email protected]>
  • Loading branch information
takayuki5168 committed Dec 10, 2024
1 parent ba91274 commit 8011efd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions common/autoware_debug_tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <file-path>
ros2 run autoware_debug_tools frequent_log_checker <launch-log-path>
```

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.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 8011efd

Please sign in to comment.