-
Notifications
You must be signed in to change notification settings - Fork 50
Task 7 (Modestov) #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AndModestov
wants to merge
3
commits into
hardcode-dev:master
Choose a base branch
from
AndModestov:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,46 @@ | ||
### Шаг 1. Сбор DX-метрики | ||
|
||
- Развернул Chronograf (репозиторий переехал https://github.com/influxdata/sandbox) | ||
- Добавил и настроил Influxer | ||
- Отправить данные из приложения в influxDB так и не вышло, т.к приложение разворачивается в докере, | ||
Chronograf - также. Спустя относительно продолжительное время так и не удалось настроить доступ к localhost:8086 из контейнера. | ||
(Errno::EADDRNOTAVAIL: Failed to open TCP connection to localhost:8086 (Cannot assign requested address - connect(2) for "localhost" port 8086)) | ||
- В тестовых целях опробовал отправку данных для DEV.to | ||
- В качестве метрики оптимизации приложения будем использовать время прохождения тестового билда, без отправки в influxDB, к сожалению | ||
|
||
### Шаг 2. Первый прогон тестов | ||
|
||
- В проекте - 2806 examples | ||
- На данный момент уже используется parallel_rspec. | ||
- Текущее время прохождения ~ 3:50. | ||
|
||
### Шаг 3. Common pitfalls fix | ||
|
||
- Sidekiq используется в режиме fake | ||
- Отключение DatabaseCleaner-а (удаление) и отключение логов ускорило прохождение тестов значительно ~ 1:54. | ||
|
||
### Шаг 4. Профилирование - 1 | ||
|
||
- Запуск тестов в режиме `--profile` показал, что 10 slowest examples занимают 5% времени прохождения тестов. | ||
Большая часть тестов из списка выполняется около секунды, не думаю что оптимизация даст весомые результаты. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Да, большой выхлоп может дать если оптимизировать что-то что у них есть общего у всех/многих (если оно конечно есть). |
||
- Для примера сгенерировал несколько отчетов, оптимизировал по мелочи несколько тестов | ||
- Также удалось найти несколько легаси тестов и удалить их, т.к функционал уже не используется и тестировать его нет смысла. | ||
- Текущее время прохождение тестов ~ 1:42 | ||
|
||
### Шаг 5. Профилирование - 2 | ||
|
||
- RSpecDissect показал что большую часть времени занимают блоки let и before. | ||
- Воспользуемся хелперами let_it_be и before_all от test-prof. | ||
- Замена сломала порядка 50% тестов. Чтобы не тратить уйму времени - ради эксперимента отрефакторим несколько тестов. | ||
- В рамках небольшого набора тестов время сократилось незначительно, но если сделать замену глобальной - эффект может быть ощутимым. | ||
|
||
### Шаг 6. Профилирование - 3 | ||
|
||
- factory-prof был опробован, весомых результатов достигнуть не удалось | ||
- factory-doctor показал Total wasted time: 00:06.314, весомого эффекта оптимизация не даст, но инструмент был опробован | ||
|
||
### Выводы. | ||
|
||
- Были опробованы многие функции test-prof, позволяющие профилировать и ускорять тесты | ||
- Время прогона тестов было сокращено c почти 4 минут до ~ 1:34 (~ в 2.5 раза). | ||
- Потенциал сокращения еще есть, но требует временных вложений. Так что взял на заметку | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Всё верно |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это должно же как-то решаться, например собрать прилагу и TICK в один docker-compose и настроить общую сеть для них.