| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Nokogiri produces inefficient XPath expressions when given CSS
expressions such as "a.gfm". Luckily these expressions can be optimized
quite easily while still achieving the same results.
In the two cases where this optimization is applied the run time has
been reduced from around 170 ms to around 15 ms.
|
|
|
|
|
|
|
| |
Around 300 ms (in total) would be spent in these delegated methods due
to the extra stuff ActiveSupport adds to the compiled methods. Because
these delegations are so simple we can just manually define the methods,
saving around 275 milliseconds.
|
|
|
|
|
| |
This is a tad faster than letting Nokogiri figure out whether it should
evaluate the query as CSS or XPath and then actually evaluating it.
|
|
|
|
|
|
|
|
| |
While it's useful to keep track of the different versions (Ruby, GitLab,
etc) doing so for every point wastes disk space and possibly also RAM
(which InfluxDB is all to eager to gobble up). If we want to see the
performance differences between different GitLab versions simply looking
at the performance since the last release date should suffice.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Revert upvotes and downvotes params back to MR API
issue https://gitlab.com/gitlab-org/gitlab-ce/issues/3672
See merge request !2212
|
| | |
|
| |
| |
| |
| |
| | |
This ensures we can still start up even when not connecting to a
database.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This removes the need for Sidekiq and any overhead/problems introduced
by TCP. There are a few things to take into account:
1. When writing data to InfluxDB you may still get an error if the
server becomes unavailable during the write. Because of this we're
catching all exceptions and just ignore them (for now).
2. Writing via UDP apparently requires the timestamp to be in
nanoseconds. Without this data either isn't written properly.
3. Due to the restrictions on UDP buffer sizes we're writing metrics one
by one, instead of writing all of them at once.
|
| |
| |
| |
| |
| | |
Newlines aren't really needed and they may mess with InfluxDB's line
protocol.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Makes reCAPTCHA configurable through Application Settings screen
Following the work made by @stanhu here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2216, made it configurable without needing to restart Gitlab
See merge request !2231
|
| | | |
|
|/ /
| |
| |
| |
| | |
This ensures we can still boot, even when the "application_settings"
table doesn't exist.
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Storing of application metrics in InfluxDB
This adds support for tracking metrics in InfluxDB, which in turn can be visualized using Grafana. For more information see #2936.
See merge request !2042
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This allows us to track the counts of actual classes instead of "T_XXX"
nodes. This is only enabled on CRuby as it uses CRuby specific APIs.
|
| | |
| | |
| | |
| | | |
This will be used to (for example) instrument all ActiveRecord models.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This ensures we don't end up wasting resources by tracking method calls
that only take a few microseconds. By default the threshold is 10
milliseconds but this can be changed using the gitlab.yml configuration
file.
|
| | |
| | |
| | |
| | |
| | | |
This makes it possible to determine if a method should be instrumented
or not using a block.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This allows the information to be displayed when using certain functions
(e.g. top()) as well as making it easier to aggregate on a per file
basis.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
InfluxDB escapes double quotes upon output which makes it a pain to deal
with. This ensures that if we're using PostgreSQL we don't store any
queries containing double quotes in InfluxDB, solving the escaping
problem.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When using instrument_methods/instrument_instance_methods we only want
to instrument methods defined directly in a class, not those included
via mixins (e.g. whatever RSpec throws in during development).
In case an externally included method _has_ to be instrumented we can
still use the regular instrument_method/instrument_instance_method
methods.
|
| | |
| | |
| | |
| | |
| | | |
This makes it easier to instrument multiple modules without having to
type the full namespace over and over again.
|
| | |
| | |
| | |
| | |
| | |
| | | |
The methods Instrumentation.instrument_methods and
Instrumentation.instrument_instance_methods can be used to instrument
all methods of a module at once.
|
| | |
| | |
| | |
| | |
| | | |
This ensures that methods such as "==" can be instrumented without
producing syntax errors.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The use of ActiveSupport would slow down instrumented method calls by
about 180x due to:
1. ActiveSupport itself not being the fastest thing on the planet
2. caller_locations() having quite some overhead
The use of caller_locations() has been removed because it's not _that_
useful since we already know the full namespace of receivers and the
names of the called methods.
The use of ActiveSupport has been replaced with some custom code that's
generated using eval() (which can be quite a bit faster than using
define_method).
This new setup results in instrumented methods only being about 35-40x
slower (compared to non instrumented methods).
|
| | |
| | |
| | |
| | |
| | | |
This is faster than using define_method since we don't have to keep
block bindings around.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The previous setup wasn't exactly fast, resulting in instrumented method
calls taking about 600 times longer than non instrumented calls
(including any ActiveSupport code involved). With this commit this
slowdown has been reduced to around 185 times.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This adds the ability to write application metrics (e.g. SQL timings) to
InfluxDB. These metrics can in turn be visualized using Grafana, or
really anything else that can read from InfluxDB. These metrics can be
used to track application performance over time, between different Ruby
versions, different GitLab versions, etc.
== Transaction Metrics
Currently the following is tracked on a per transaction basis (a
transaction is a Rails request or a single Sidekiq job):
* Timings per query along with the raw (obfuscated) SQL and information
about what file the query originated from.
* Timings per view along with the path of the view and information about
what file triggered the rendering process.
* The duration of a request itself along with the controller/worker
class and method name.
* The duration of any instrumented method calls (more below).
== Sampled Metrics
Certain metrics can't be directly associated with a transaction. For
example, a process' total memory usage is unrelated to any running
transactions. While a transaction can result in the memory usage going
up there's no accurate way to determine what transaction is to blame,
this becomes especially problematic in multi-threaded environments.
To solve this problem there's a separate thread that takes samples at a
fixed interval. This thread (using the class Gitlab::Metrics::Sampler)
currently tracks the following:
* The process' total memory usage.
* The number of file descriptors opened by the process.
* The amount of Ruby objects (using ObjectSpace.count_objects).
* GC statistics such as timings, heap slots, etc.
The default/current interval is 15 seconds, any smaller interval might
put too much pressure on InfluxDB (especially when running dozens of
processes).
== Method Instrumentation
While currently not yet used methods can be instrumented to track how
long they take to run. Unlike the likes of New Relic this doesn't
require modifying the source code (e.g. including modules), it all
happens from the outside. For example, to track `User.by_login` we'd add
the following code somewhere in an initializer:
Gitlab::Metrics::Instrumentation.
instrument_method(User, :by_login)
to instead instrument an instance method:
Gitlab::Metrics::Instrumentation.
instrument_instance_method(User, :save)
Instrumentation for either all public model methods or a few crucial
ones will be added in the near future, I simply haven't gotten to doing
so just yet.
== Configuration
By default metrics are disabled. This means users don't have to bother
setting anything up if they don't want to. Metrics can be enabled by
editing one's gitlab.yml configuration file (see
config/gitlab.yml.example for example settings).
== Writing Data To InfluxDB
Because InfluxDB is still a fairly young product I expect the worse.
Data loss, unexpected reboots, the database not responding, you name it.
Because of this data is _not_ written to InfluxDB directly, instead it's
queued and processed by Sidekiq. This ensures that users won't notice
anything when InfluxDB is giving trouble.
The metrics worker can be started in a standalone manner as following:
bundle exec sidekiq -q metrics
The corresponding class is called MetricsWorker.
|
|\ \ \
| |_|/
|/| |
| | |
| | |
| | |
| | | |
Only allow group/project members to mention `@all`
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/3473
See merge request !2205
|
| |\ \ |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Add API support for looking up a user by username
Needed to support Huboard
See merge request !2089
|
| |/ / /
| | | |
| | | |
| | | | |
Needed to support Huboard
|
| |/ /
|/| | |
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fix identity and user retrieval when special characters are used
Fixes #4023
I also added tests to make sure the user with special characters in his name is returned correctly.
@rspeicher this probably should be added to 8.3 as a patch.
See merge request !2176
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Automatically fork a project when not allowed to edit a file.
Fixes #3215.
To do:
- [ ] Add tests
-----
## "Edit" button on file in a project the user does NOT have write access to
![edit_file](/uploads/7602157420768aef483a6586bba2d164/edit_file.png)
## Clicking will automatically create a fork
![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png)
## When the fork has been created, the user is returned to the edit page on the original project with a notice
![edit_notice](/uploads/94ed1319404370ff1e9c0d672fb41e03/edit_notice.png)
## The user cannot change the target branch and is informed that editing will start an MR
![edit_footer](/uploads/4da68d4795c7177e575b7c434d16eeae/edit_footer.png)
## Hitting "Commit changes" will commit and start an MR from my fork to the origin project
![Screen_Shot_2015-12-17_at_23.38.08](/uploads/d777a4db6f38a5a1be84031694465bc1/Screen_Shot_2015-12-17_at_23.38.08.png)
-----
## "Create file, "Upload file" and "New directory" buttons in a project the user does NOT have write access to
![new_directory](/uploads/72f556248f30d6652523bbb4be01b3e0/new_directory.png)
## Clicking any of these options will automatically create a fork
![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png)
## When the fork has been created, the user is returned to the tree page on the original project with a notice
![new_directory_notice](/uploads/a1a3e11308ae0e8f0913fae6813a37ed/new_directory_notice.png)
## Clicking "New directory" again will show the modal. The user cannot change the target branch and is informed that editing will start an MR
![new_dir](/uploads/99ca8cbfb2f70603e352b3fdf67b6281/new_dir.png)
## Hitting "Create directory" will commit and start an MR from my fork to the origin project
![Screen_Shot_2015-12-17_at_23.39.19](/uploads/3713d0235abf831361b803a6198c5bc1/Screen_Shot_2015-12-17_at_23.39.19.png)
cc @dzaporozhets @skyruler
See merge request !2145
|
| | |/
| |/| |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fix/visibility level setting in forked projects
Fixes #3136
/cc @DouweM
See merge request !1744
|
| |\ \ \
| | |/ /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* master: (723 commits)
Bump Rack Attack to v4.3.1 for security fix
Remove duplicate entry in the changelog
Remove extra spaces after branchname
Fix merge-request-reopen button title
Add branch and tag operation to tree dropdown
Use gitlab-shell 2.6.9
Clarify Windows shell executor artifact upload support
Fix feature specs: we always show the build status if ci_commit is present
Do not display project group/name when issue and MR are in same project
Don't create CI status for refs that doesn't have .gitlab-ci.yml, even if the builds are enabled
Use gitlab-workhorse 0.5.1
Fix ci_projects migration by using the value only from latest row [ci skip]
Revert sidebar position for issue and merge request
Add info on using private Docker registries in CI [ci skip]
Upgrade Poltergeist to 1.8.1. #4131
Fix ux issue with "This issue will be closed automatically" message
Move MR Builds tab next to Commits
Api support for requesting starred projects for user
Fix Rubocop complain.
Fix merge widget JS for buttons
...
Conflicts:
app/models/project.rb
|
| |\ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* master: (296 commits)
fox tests
Don't rescue Exception, but StandardError
adressing comments
Update gitlab-shell documentation [ci skip]
Align hash literals in IssuesFinder spec
Fix tests
Fix 'Attach a file' link in new tag form
Add link to git-lfs client [ci skip]
Do not limit workhorse POST/PUT size in NGINX
added specs
added spinach tests
Since GitLab CI is enabled by default, remove enabling it by pushing .gitlab-ci.yml
Fix tests
Commits without .gitlab-ci.yml are marked as skipped
Changelog entry for finding issues performance
Use a JOIN in IssuableFinder#by_project
Memoize IssuableFinder#projects
Removed trailing whitespace from IssuableFinder
Added benchmark for IssuesFinder
Updated DB schema with new issues/projects indexes
...
Conflicts:
app/models/project.rb
|
| |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* master: (23 commits)
Use single spaces
Improvements to profile page UI
Replace all usages of `git` command with configurable binary path
Update Shell Commands doc for configurable git binary path
Minor reformatting for Facebook integration doc
Use proper labels for OAuth providers
Add Facebook authentication
Bump stamp to ~> 0.6.0
Add extra padding between user description and links on profile page
Fix tests
Fix clipboard button overflow
Apply new design for user profile page
Improve profile page UI
Better name for up-level links
Fixed User sorting specs
Only sort by IDs by default
Added benchmark for User.all
Add changelog entry for contacted_at
Spread out runner contacted_at updates
Only redirect to homepage url when its not the root url
...
|
| | | | | | |
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Emoji picker: better alias handling
related to https://gitlab.com/gitlab-org/gitlab-ce/issues/3576
See merge request !2198
|