-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Задание | ||
Ротация perf файлов: | ||
- Проверка суммарного размера всех perf файлов. | ||
- Выбор и удаление perf файлов. | ||
- Удаление записей из БД. | ||
|
||
# План | ||
1. После оптимизации: собрать все уникальные perf файлы. | ||
2. Просуммировать размер perf файлов на диске. | ||
3. Проверить, превышен ли заданный порог (для начала 100Мб). | ||
4. Если превышен, то начать удалять perf файлы: | ||
- проверить modification time [os.path.getmtime(path)](https://docs.python.org/3/library/os.path.html#os.path.getmtime) | ||
- по порядку от самых старых до самых новых: | ||
- удалить записи в БД с данным perf_file | ||
- удалить perf_file с диска | ||
- если суммарный размер меньше порога - выход из цикла |