Log Cleaner Stage
The Log Cleaner Stage will allow you to keep a directory of logs on your robot trimmed to only consume a fixed amount of space.
For example, if you don’t intend to offload logs very often, and want to store no more then 20GB of logs, you can use this tool to periodically delete old logs and keep only the newest.
Configuration
A LogCleanerStageConfiguration
structure is passed to the log cleaner:
storage_base_path
- The path to the area on disk to keep cleanmaximum_log_usage_mb
- The amount of space (in megabytes) that can be used by logscheck_interval_ms
- The interval to check for free spaceminimum_file_age_s
- Refuse to delete files younger then this age
The log cleaner will not delete any logs that are being actively written to, no matter how old they are.
Interacting
The stage works on its own. It needs no input to function.
Metrics
The stage emits statistics periodically on the statistics
channel. This indicates
how many logs it has removed or any other errors it has encountered.
cycles_executed_successfully
- The number of cycles we have runcycles_failed
- The number of cycles we experienced an exception/error on (should be zero)files_removed
- The number of files that have been removedvisible_log_count
- The number of visible logslog_disk_space_consumed_b
- The amount of disk space consumed by data logs right now