summaryrefslogtreecommitdiff
path: root/app/workers
Commit message (Collapse)AuthorAgeFilesLines
* Extract Projects::ImportService service from RepositoryImportWorkerDouglas Barbosa Alexandre2016-01-251-39/+7
|
* Write to InfluxDB directly via UDPYorick Peterse2015-12-291-33/+0
| | | | | | | | | | | | | 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.
* Drop empty tag values from metricsYorick Peterse2015-12-171-1/+5
| | | | | InfluxDB throws an error when trying to store a list of tags where one or more have an empty value.
* Cast values to strings before escaping themYorick Peterse2015-12-171-1/+1
| | | | | This ensures that e.g. line numbers used in tags are first casted to strings.
* Storing of application metrics in InfluxDBYorick Peterse2015-12-171-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Migrate CI WebHooks and Emails to new tablesKamil Trzcinski2015-12-101-1/+1
|
* Migrate CI::Services and CI::WebHooks to Services and WebHooksKamil Trzcinski2015-12-104-38/+19
|
* Merge branch 'master' into zj/gitlab-ce-merge-if-greenDouwe Maan2015-12-081-3/+0
|\
| * Migrate from Sidetiq to Sidekiq-cronfeature/sidekiq-cronGabriel Mazetto2015-12-041-3/+0
| | | | | | | | Updated Sidekiq to 3.5.x
* | Merge branch 'master' into merge-if-greenZeger-Jan van de Weg2015-12-075-35/+48
|\ \ | |/
| * fix specsrails_update_to_4_2Valery Sizov2015-11-301-1/+1
| |
| * Migrate mailers to ActiveJobValery Sizov2015-11-261-1/+1
| |
| * Rails update to 4.2.4Valery Sizov2015-11-251-1/+1
| |
| * Fix 500 when using CIci-fix-500Kamil Trzcinski2015-11-231-0/+3
| | | | | | | | | | | | - Fix for Ci::Build state machine, allowing to process builds without the project - Forcefully update builds that didn't want to update with state machine - Fix saving GitLabCiService as Admin Template
| * Remove accidentally added line. #3598issue_3598Rubén Dávila2015-11-201-3/+0
| | | | | | | | It should exist in EE only.
| * Remove unused variable in repository importDouwe Maan2015-11-181-1/+1
| |
| * Store and show reason why import failed.Douwe Maan2015-11-182-34/+47
| |
* | Merge branch 'master' into merge-if-greenZeger-Jan van de Weg2015-11-181-0/+18
|\ \ | |/
| * Cleanup stuck CI builds dailydrop-old-buildsKamil Trzcinski2015-11-031-0/+18
| |
* | API support, incorporated feedbackZeger-Jan van de Weg2015-11-181-11/+2
|/
* Remove unused sidekiq workerJacob Vosmaer2015-10-201-43/+0
|
* Clear archive cache asynchronouslyJacob Vosmaer2015-10-201-0/+9
|
* Rename reply_by_email to incoming_email to prepare for the future.Douwe Maan2015-09-211-1/+1
|
* remove API calls from CE to CIci_closer_integrationValery Sizov2015-09-181-12/+0
|
* Merge remote-tracking branch 'origin/master' into ↵Kamil Trzcinski2015-09-151-0/+34
|\ | | | | | | | | | | | | ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-g # Conflicts: # Gemfile.lock
| * Import forked repositories asynchronously to prevent large repositories from ↵Stan Hu2015-09-111-0/+34
| | | | | | | | | | | | | | | | | | timing out Use import_status to track async import status and give feedback to the user Closes #2388 Closes #2400
* | Merge branch 'master' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-gDmitriy Zaporozhets2015-09-092-13/+26
|\ \ | |/
| * FogBugz project importJared Szechy2015-09-081-13/+22
| |
| * Expire cache when merge request source branch was removedfix-branches-cache-after-mergeDmitriy Zaporozhets2015-08-281-0/+4
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Merge branch 'master' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-gDouwe Maan2015-08-262-14/+21
|\ \ | |/
| * Merge branch 'handle-smtp-input-errors' into 'master'Dmitriy Zaporozhets2015-08-251-14/+19
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries ### What does this MR do? This MR gracefully handles SMTP input errors (e.g. incorrect or invalid e-mail addresses) to prevent these types of exceptions from causing Sidekiq to retry the task. If these specific exceptions occur, they will be logged, and the e-mail will be dropped from the queue. ### Why was this MR needed? If you include an author that has a misspelled e-mail address, Sidekiq will keep sending e-mail to all the recipients even if they have already received the e-mail. The only way to recover is to clear the Sidekiq queue. Note that other exceptions can still be thrown (e.g. `IOError`, `Net::SMTPAuthenticationError`, `Net::SMTPServerBusy`, `Net::SMTPUnknownError`, and `TimeoutError`). If the worker encounters these, Sidekiq should retry the task. ### What are the relevant issue numbers? Closes https://github.com/gitlabhq/gitlabhq/issues/9560 See merge request !1163
| | * Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to ↵Stan Hu2015-08-191-14/+19
| | | | | | | | | | | | | | | | | | prevent Sidekiq retries Closes https://github.com/gitlabhq/gitlabhq/issues/9560
| * | Ignore empty incoming messages.Douwe Maan2015-08-241-0/+2
| | |
* | | Groundwork for merging CI into CEDouwe Maan2015-08-253-0/+38
|/ /
* | Remove user OAuth tokens stored in database for Bitbucket, GitHub, and GitLabStan Hu2015-08-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and request them each session. Pass these tokens to the project import data. This prevents the need to encrypt these tokens and clear them in case they expire or get revoked. For example, if you deleted and re-created OAuth2 keys for Bitbucket, you would get an Error 500 with no way to recover: ``` Started GET "/import/bitbucket/status" for x.x.x.x at 2015-08-07 05:24:10 +0000 Processing by Import::BitbucketController#status as HTML Completed 500 Internal Server Error in 607ms (ActiveRecord: 2.3ms) NameError (uninitialized constant Import::BitbucketController::Unauthorized): app/controllers/import/bitbucket_controller.rb:77:in `rescue in go_to_bitbucket_for_permissions' app/controllers/import/bitbucket_controller.rb:74:in `go_to_bitbucket_for_permissions' app/controllers/import/bitbucket_controller.rb:86:in `bitbucket_unauthorized' ``` Closes #1871
* | Block blocked users from replying to threads by email.reply-by-emailDouwe Maan2015-08-211-0/+2
| |
* | Merge branch 'master' into reply-by-emailDouwe Maan2015-08-203-14/+19
|\ \ | |/
| * Revert "Merge branch 'revert-satellites' into 'master' "Dmitriy Zaporozhets2015-08-113-14/+19
| | | | | | | | | | This reverts commit 5daf44b7c86e0e2641a902b1da8b01d91fa3dbfa, reversing changes made to 2f706fbd231cabe7a76a5d17ac44285aaaf8592c.
* | Make error class names more consistent.Douwe Maan2015-08-201-2/+2
| |
* | Extract ReplyParser and AttachmentUploader from Receiver.Douwe Maan2015-08-201-8/+8
| |
* | Send a rejection email when the incoming email couldn't be processed.Douwe Maan2015-08-191-6/+31
| |
* | Changes and stuff.Douwe Maan2015-08-181-1/+1
| |
* | Reply by email POCDouwe Maan2015-08-181-0/+22
|/
* Revert "Merge branch 'drop-satellites'"Dmitriy Zaporozhets2015-08-113-19/+14
| | | | | | | This reverts commit 957e849f41d96fa9778fcdd06792d2f0274b29ab, reversing changes made to 6b9dbe9f5a175a8162abf296367f561bab3eea1a. Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Trigger post-receive hoooks when commits are made by GitLabtrigger-hooksDmitriy Zaporozhets2015-08-101-1/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Merge branch 'master' into drop-satellitesDmitriy Zaporozhets2015-08-042-1/+16
|\ | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Avoid cache building for super-weird case when repository root_ref is nilDmitriy Zaporozhets2015-07-171-1/+4
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Store commit count in project tableadvanced-cacheDmitriy Zaporozhets2015-07-172-2/+5
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Build missing cache items in background job after each pushDmitriy Zaporozhets2015-07-171-0/+9
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Huge refactoring for accepting merge requestsDmitriy Zaporozhets2015-07-162-13/+19
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>