summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Define a limited set of filters for SingleLinePipeliners-issue-1697Robert Speicher2016-01-051-0/+16
| | | | | | | | | | | | Removes the following filters from its parent GfmPipeline: - SyntaxHighlightFilter - UploadLinkFilter - TableOfContentsFilter - LabelReferenceFilter - TaskListFilter Closes #1697
* Make sure that is no pending migrations in Gitlab::CurrentSettingsfix-buildDouglas Barbosa Alexandre2015-12-301-1/+3
|
* Merge branch 'upvote_count_to_api' into 'master' Valery Sizov2015-12-291-1/+0
|\ | | | | | | | | | | | | Revert upvotes and downvotes params back to MR API issue https://gitlab.com/gitlab-org/gitlab-ce/issues/3672 See merge request !2212
| * Revert upvotes and downvotes params to MR APIValery Sizov2015-12-281-1/+0
| |
* | Use Gitlab::CurrentSettings for InfluxDBYorick Peterse2015-12-291-25/+11
| | | | | | | | | | This ensures we can still start up even when not connecting to a database.
* | Write to InfluxDB directly via UDPYorick Peterse2015-12-296-13/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Strip newlines from obfuscated SQLYorick Peterse2015-12-291-1/+1
| | | | | | | | | | Newlines aren't really needed and they may mess with InfluxDB's line protocol.
* | Merge branch 'feature/recaptcha_settings' into 'master' Dmitriy Zaporozhets2015-12-291-0/+14
|\ \ | | | | | | | | | | | | | | | | | | 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
| * | reCAPTCHA is configurable through Admin Settings, no reload needed.Gabriel Mazetto2015-12-281-0/+14
| | |
* | | Handle missing settings table for metricsYorick Peterse2015-12-281-6/+10
|/ / | | | | | | | | This ensures we can still boot, even when the "application_settings" table doesn't exist.
* | Move InfluxDB settings to ApplicationSettingrelocate-influxdb-settingsYorick Peterse2015-12-281-8/+24
| |
* | Merge branch 'influxdb' into 'master' Dmitriy Zaporozhets2015-12-2812-0/+702
|\ \ | | | | | | | | | | | | | | | | | | 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
| * | Added host option for InfluxDBinfluxdbYorick Peterse2015-12-281-1/+2
| | |
| * | Use String#delete for removing double quotesYorick Peterse2015-12-281-1/+1
| | |
| * | Track object counts using the "allocations" GemYorick Peterse2015-12-172-3/+26
| | | | | | | | | | | | | | | 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.
| * | Support for instrumenting class hierarchiesYorick Peterse2015-12-171-0/+23
| | | | | | | | | | | | This will be used to (for example) instrument all ActiveRecord models.
| * | Only track method calls above a certain thresholdYorick Peterse2015-12-172-3/+9
| | | | | | | | | | | | | | | | | | | | | 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.
| * | Allow filtering of what methods to instrumentYorick Peterse2015-12-171-2/+17
| | | | | | | | | | | | | | | This makes it possible to determine if a method should be instrumented or not using a block.
| * | Track location information as tagsYorick Peterse2015-12-172-12/+22
| | | | | | | | | | | | | | | | | | 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.
| * | Replace double quotes when obfuscating SQLYorick Peterse2015-12-171-1/+9
| | | | | | | | | | | | | | | | | | | | | 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.
| * | Track object count types as tagsYorick Peterse2015-12-171-1/+3
| | |
| * | Only instrument methods defined directlyYorick Peterse2015-12-171-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Added Instrumentation.configureYorick Peterse2015-12-171-0/+4
| | | | | | | | | | | | | | | This makes it easier to instrument multiple modules without having to type the full namespace over and over again.
| * | Methods for instrumenting multiple methodsYorick Peterse2015-12-171-0/+23
| | | | | | | | | | | | | | | | | | The methods Instrumentation.instrument_methods and Instrumentation.instrument_instance_methods can be used to instrument all methods of a module at once.
| * | Proper method instrumentation for special symbolsYorick Peterse2015-12-171-4/+5
| | | | | | | | | | | | | | | This ensures that methods such as "==" can be instrumented without producing syntax errors.
| * | Use custom code for instrumenting method callsYorick Peterse2015-12-172-48/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
| * | Use string evaluation for method instrumentationYorick Peterse2015-12-172-9/+11
| | | | | | | | | | | | | | | This is faster than using define_method since we don't have to keep block bindings around.
| * | Improved last_relative_application_frame timingsYorick Peterse2015-12-171-5/+8
| | | | | | | | | | | | | | | | | | | | | 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.
| * | Storing of application metrics in InfluxDBYorick Peterse2015-12-1713-0/+594
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'mention-all' into 'master' Robert Speicher2015-12-275-13/+40
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Only allow group/project members to mention `@all` Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/3473 See merge request !2205
| * | Merge branch 'master' into mention-allDouwe Maan2015-12-242-4/+4
| |\ \
| * | | Only allow group/project members to mention `@all`Douwe Maan2015-12-245-13/+40
| | | |
* | | | Merge branch 'support-api-lookup-by-username' into 'master' Dmitriy Zaporozhets2015-12-251-4/+10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add API support for looking up a user by username Needed to support Huboard See merge request !2089
| * | | | Add API support for looking up a user by usernameStan Hu2015-12-241-4/+10
| |/ / / | | | | | | | | | | | | Needed to support Huboard
* | | | Escape all the things.Douwe Maan2015-12-245-17/+20
| |/ / |/| |
* | | Merge branch 'ldap-special-chars-fix' into 'master' Douwe Maan2015-12-242-4/+4
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | No mb_chars needed anymoreldap-special-chars-fixDouwe Maan2015-12-241-2/+2
| | |
| * | Fix identity and user retrieval when special characters are usedPatricio Cano2015-12-222-3/+3
| | |
* | | Merge branch 'edit-on-fork' into 'master' Dmitriy Zaporozhets2015-12-241-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Automatically fork a project when not allowed to edit a file.Douwe Maan2015-12-181-1/+1
| | |/ | |/|
* | | Merge branch 'fix/visibility-level-setting-in-forked-projects' into 'master' Douwe Maan2015-12-241-0/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix/visibility level setting in forked projects Fixes #3136 /cc @DouweM See merge request !1744
| * \ \ Merge branch 'master' into fix/visibility-level-setting-in-forked-projectsTomasz Maczukin2015-12-21118-1645/+1897
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | | Merge branch 'master' into fix/visibility-level-setting-in-forked-projectsTomasz Maczukin2015-11-2049-339/+1734
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * \ \ \ Merge branch 'master' into fix/visibility-level-setting-in-forked-projectsTomasz Maczukin2015-11-048-17/+26
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 ...
| * | | | | Fix GitlabV::isibilityLevel::level_name methodTomasz Maczukin2015-11-041-1/+1
| | | | | |
| * | | | | Move level_name resolving to Gitlan::VisibilityLevelTomasz Maczukin2015-11-031-0/+9
| | | | | |
* | | | | | Merge branch 'emoji-picker-fix' into 'master' Valery Sizov2015-12-241-36/+17
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Emoji picker: better alias handling related to https://gitlab.com/gitlab-org/gitlab-ce/issues/3576 See merge request !2198
| * | | | | | Emoji picker: better alias handlingValery Sizov2015-12-241-36/+17
| | | | | | |
* | | | | | | Fix spelling of "it's" to "its" where appropriate.cafuego2015-12-242-7/+7
| | | | | | |
* | | | | | | Merge branch 'add-project-permissions' into 'master' Dmitriy Zaporozhets2015-12-231-3/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add project permissions to all project API endpoints This standardizes all the project API formats. Also needed to support Huboard. See merge request !2090