feat: web progress bar - #423
Conversation
Artanias
left a comment
There was a problem hiding this comment.
Нужно разрешить конфликты с main веткой.
|
|
||
| if (currentRun > 0 && currentRun <= totalRuns) { | ||
| runsBar.classList.add('pulse'); | ||
| runsText.textContent = `Run ${currentRun} out of ${totalRuns} is in progress (${runsPercent}%)`; |
| document.getElementById('last-profile').textContent = data.last_profile_done; | ||
| }) | ||
| .catch(error => { | ||
| console.error('JSON processing error:', error); |
| function updateDashboard(taskId) { | ||
| fetch("/current-progress/" + taskId + "/", { cache: "no-store" }) | ||
| .then(response => { | ||
| if (!response.ok) throw new Error('Data load error'); |
| self.progress_data = {} | ||
| self.proc_to_task = {} |
There was a problem hiding this comment.
Тут потецниальная "утечка" памяти, т.к. от каждого запуска будет забиваться и не вичищаться после тестов.
| def __get_progress_handler() -> ProgressHandler: | ||
| progress_handle = ProgressHandler() | ||
| progress_handle.setLevel(logging.DEBUG) | ||
| progress_handle.setFormatter(StreamFormatter()) | ||
| progress_handle.set_name("progress_handler") | ||
|
|
||
| return progress_handle |
There was a problem hiding this comment.
Лучше бы это всё проворачивать более явно, нежели чем через парсинг логов, т.к кажется, что поменяются логи, а они соответственно меняются, то всё сломается и будет сходу не понятно, что делать, где чинить.
There was a problem hiding this comment.
Также в БД попадают уже сейчас результаты тестов, может получится их расширить и оттуда вычислять значения?
X1pster
left a comment
There was a problem hiding this comment.
Нужно разрешить конфликт с main-веткой
| checkStatus(); | ||
| } | ||
|
|
||
| const PRGORESS_POLLING_INTERVAL = 3000; |
There was a problem hiding this comment.
Нигде не используется, также надо бы исправить название, а то здесь опечатка.
Можно либо совсем удалить, либо использовать в функции pollStatus:
вместо
setTimeout(checkStatus, 2000);
сделать так:
setTimeout(checkStatus, PROGRESS_POLLING_INTERVAL);
| </div> | ||
|
|
||
| <div id="progress-card" class="progress-card" style="display: none;"> | ||
| <h2>Progress</h2> |
There was a problem hiding this comment.
Здесь и далее надо бы тоже добавить переводы.
AndrewGavril
left a comment
There was a problem hiding this comment.
С переводами зря затеяли усложнение кода (точнее не самого кода, а его контроль). Нужно было остановиться на одном языке -- английском.
|
|
||
|
|
||
| class ProgressHandler(logging.Handler): | ||
| progress_template = { # noqa: RUF012 |
There was a problem hiding this comment.
Вообще хорошо бы учитывать время теста, которое мы вносим в конфигурацию. Мы можем приблизительно оценить время на тесты исходя из конфигурации. И прогресс считать относительно этого.
#408