Use clock_gettime for all performance timestamps
This MR adjusts the performance monitoring code to use `Process.clock_gettime` (thus `clock_gettime(3)`) instead of `Time.now`.
Using `Time.now` / `Time.new` adds more overhead than `Process.clock_gettime`, it also doesn't provide a way of getting timestamps in nanoseconds (which `Process.clock_gettime` does allow).
See merge request !4899
Implement UI for new project page
## What does this MR do?
Updates the project creation page to conform with the latest UI updates.
## Are there points in the code the reviewer needs to double check?
Ney.
## Why was this MR needed?
Updated UI.
## What are the relevant issue numbers?
Closes#2542.
## Screenshots (if relevant)
**Desktop:**

**Mobile:**

See merge request !4766
Process.clock_gettime allows getting the real time in nanoseconds as
well as allowing one to get a monotonic timestamp. This offers greater
accuracy without the overhead of having to allocate a Time instance. In
general using Time.now/Time.new is about 2x slower than using
Process.clock_gettime(). For example:
require 'benchmark/ips'
Benchmark.ips do |bench|
bench.report 'Time.now' do
Time.now.to_f
end
bench.report 'clock_gettime' do
Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
end
bench.compare!
end
Running this benchmark gives:
Calculating -------------------------------------
Time.now 108.052k i/100ms
clock_gettime 125.984k i/100ms
-------------------------------------------------
Time.now 2.343M (± 7.1%) i/s - 11.670M
clock_gettime 4.979M (± 0.8%) i/s - 24.945M
Comparison:
clock_gettime: 4979393.8 i/s
Time.now: 2342986.8 i/s - 2.13x slower
Another benefit of using Process.clock_gettime() is that we can simplify
the code a bit since it can give timestamps in nanoseconds out of the
box.
Unused gon variable with very bad performance
## What does this MR do?
Remove an unused variable with a lot of performance penalty. It was opening a transaction just to return a constant string.
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
See merge request !4969
In any case if just want the value which is always ‘gitlab’
require 'benchmark/ips'
Project.first # To load database things
GitlabIssueTrackerService.first # To load database things
Benchmark.ips do |x|
x.config(:time => 5, :warmup => 2)
x.report("current") do
Project.new.default_issue_tracker.to_param
end
x.report("") do
'gitlab'
end
x.compare!
end
Calculating -------------------------------------
current 4.000 i/100ms
30.938k i/100ms
-------------------------------------------------
current 47.298 (±10.6%) i/s - 232.000
4.366M (±20.9%) i/s - 17.202M
Comparison:
: 4366456.0 i/s
current: 47.3 i/s - 92318.26x slower
Switched mobile button icons to ellipsis and angle
## What does this MR do?
Switches the mobile button icons
## What are the relevant issue numbers?
Closes#19170
Part of #19200
## Screenshots (if relevant)

See merge request !4944
Resolve "Pin should show up at 1280px min"
## What does this MR do?
Decreased window min width for pinned sidebar
## What are the relevant issue numbers?
Closes #19171
Part of #19200
## Screenshots (if relevant)

See merge request !4947
Use GIT_DEPTH for builds
## What does this MR do?
Enables experimental feature to use shallow cloning.
## Why was this MR needed?
To speed up the builds and reduce the pressure on NFS servers. This should save us between 30s to 1m of the time of each build.
## More information
`GIT_DEPTH`: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/merge_requests/188
## Problems
- Too small value for `GIT_DEPTH` can make it impossible to retry old changes.
You will see `unresolved reference` in build log.
We should then reconsider changing `GIT_DEPTH` to higher value
- Mechanism that rely on `git describe` may not work correctly when `GIT_DEPTH` is set. This will happen, because only part of the git history is present on the build machine
## Requirements
GitLab Runner 1.3.0. Currently all our internal runners use beta release or 1.3.0 with support for `GIT_DEPTH`.
@pcarranza Please decide when to merge that. We should start monitoring to see an impact on our NFS servers.
cc @jacobvosmaer-gitlab @pcarranza
See merge request !4730
Display last commit of deleted branch in push events
## What does this MR do?
Display the last commit of a deleted branch in the push events of a project.
## Are there points in the code the reviewer needs to double check?
Is the change in `app/models/event.rb` the correct way to display a two-line event for deleted branches?
## Why was this MR needed?
It is easier to restore an accidentally deleted branch if the commit hash is displayed in the push events.
## What are the relevant issue numbers?
Fixes#18659
## Screenshots
### Before garbage collection

### After garbage collection

See merge request !4699
1. Return 404 if commit is not found (RESTful resource not found)
2. Return an empty array if pipeline is not found (resource present, no
associated builds found)
3. Return an empty array if pipeline found but no builds there (resource
present, no associated builds)
Fix encrypted data backwards compatibility after upgrading attr_encrypted gem
Adds missing attribute to attr_encrypted so it is fully backwards-compatible. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19073
See merge request !4963
Completed new project page
Updated CHANGELOG
Corrected 'Create project' button
Made responsive
Added gitlab export button
Changed Spinach test to match updated UI
reverted test changes and fixed UI
Corrected 'Repo by URL' text
Fixed static namespace style
Added errors partial
Added padding to bottom of page-with-sidebar
Rename Licenses API to License Templates API
## What does this MR do?
Earlier I renamed this in EE, thinking license templates was an EE-only feature. This backports that change to CE. Thanks to @vsizov for pointing out this error.
See https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/400 for the EE merge request.
See merge request !4957