-
Notifications
You must be signed in to change notification settings - Fork 115
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
Домашнее задание №3 (Лисичкин Дмитрий) #99
Open
Tab10id
wants to merge
34
commits into
hardcode-dev:master
Choose a base branch
from
Tab10id: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
34 commits
Select commit
Hold shift + click to select a range
208b9eb
Add tools
Tab10id bf737ab
Extract rake task to separate class for simplify optimisations
Tab10id 2758b67
Prepare code for analyze
Tab10id 438b5ce
Add activerecord-import
Tab10id 1bd2f31
initial case-study
Tab10id eda8811
Add basic test
Tab10id f069564
Add script for performance analyse only after tests run
Tab10id 60b0a15
Add first measure results
Tab10id a1117aa
Extract model creation to separate methods
Tab10id 4534a50
Remove unnecessary updates for bus creation
Tab10id d86dde7
Import bus services
Tab10id 5366053
Remove unnecessary service find in db
Tab10id 21547a5
Import trips
Tab10id a05f483
Remove unnecessary city find in db
Tab10id add9e9b
Add first analyze of TripsController work
Tab10id 1de56a0
Add rack-mini-profiler
Tab10id 492c5b6
Add rack-mini-profiler study info
Tab10id f80e385
Fix N+1
Tab10id b21f534
Improve collection render
Tab10id aa452cb
Fix list of used instruments
Tab10id b98ea4f
Update task requirements
Tab10id aa1f6d4
Add stream import idea
Tab10id 2ce3813
Enable gc for benchmark measure (was disabled by mistake)
Tab10id 9952b56
Add oj parse
Tab10id 2d271fd
Allow to parse gzipped files
Tab10id 7ab2db6
Cleanup code
Tab10id e8a725c
Implement batch import from parse stream
Tab10id 68694a2
Allow to set batch size in rake task
Tab10id ad0d363
Add stream parse and batch import study report
Tab10id c23164b
Add study report about activerecord cost
Tab10id d96981e
Add study report about bus import
Tab10id 2e7adf3
Remove wrong assumption
Tab10id 340123d
Add time results to study file
Tab10id da6397f
fix typo and style
Tab10id 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 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
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,13 @@ | ||
<li><%= "Отправление: #{trip.start_time}" %></li> | ||
<li><%= "Прибытие: #{(Time.parse(trip.start_time) + trip.duration_minutes.minutes).strftime('%H:%M')}" %></li> | ||
<li><%= "В пути: #{trip.duration_minutes / 60}ч. #{trip.duration_minutes % 60}мин." %></li> | ||
<li><%= "Цена: #{trip.price_cents / 100}р. #{trip.price_cents % 100}коп." %></li> | ||
<li><%= "Автобус: #{trip.bus.model} №#{trip.bus.number}" %></li> | ||
<ul> | ||
<li><%= "Отправление: #{trip.start_time}" %></li> | ||
<li><%= "Прибытие: #{(Time.parse(trip.start_time) + trip.duration_minutes.minutes).strftime('%H:%M')}" %></li> | ||
<li><%= "В пути: #{trip.duration_minutes / 60}ч. #{trip.duration_minutes % 60}мин." %></li> | ||
<li><%= "Цена: #{trip.price_cents / 100}р. #{trip.price_cents % 100}коп." %></li> | ||
<li><%= "Автобус: #{trip.bus.model} №#{trip.bus.number}" %></li> | ||
<% if trip.bus.services.present? %> | ||
<li>Сервисы в автобусе:</li> | ||
<ul> | ||
<%= render partial: 'service', collection: trip.bus.services %> | ||
</ul> | ||
<% end %> | ||
</ul> |
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 |
---|---|---|
|
@@ -5,12 +5,4 @@ | |
<%= "В расписании #{@trips.count} рейсов" %> | ||
</h2> | ||
|
||
<% @trips.each do |trip| %> | ||
<ul> | ||
<%= render "trip", trip: trip %> | ||
<% if trip.bus.services.present? %> | ||
<%= render "services", services: trip.bus.services %> | ||
<% end %> | ||
</ul> | ||
<%= render "delimiter" %> | ||
<% end %> | ||
<%= render partial: 'trip', collection: @trips, spacer_template: 'delimiter' %> | ||
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. Идеально |
Oops, something went wrong.
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.
👍 👍