Commit Graph
10880 Commits
Author SHA1 Message Date
Yorick Peterse d67e2045a0 Drop empty tag values from metrics
InfluxDB throws an error when trying to store a list of tags where one
or more have an empty value.
2015-12-17 17:25:48 +01:00
Yorick Peterse 5142c61707 Cast values to strings before escaping them
This ensures that e.g. line numbers used in tags are first casted to
strings.
2015-12-17 17:25:48 +01:00
Yorick Peterse 141e946c3d Storing of application metrics in InfluxDB
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.
2015-12-17 17:25:48 +01:00
Dmitriy Zaporozhets 4b7c9c7fe2 Revert sidebar position for issue and merge request
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-17 10:34:15 +01:00
Dmitriy Zaporozhets 3162a5a293 Fix ux issue with "This issue will be closed automatically" message
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-17 00:04:29 +01:00
Dmitriy Zaporozhets a9b078535b Merge branch 'move-mr-builds-tab' into 'master'
Move MR Builds tab next to Commits

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/4132

@dzaporozhets We've got two people who feel strongly about this now, @sytses filed an issue for it :)

![Screen_Shot_2015-12-16_at_22.19.35](/uploads/37e705610ba54e386928d7972398c247/Screen_Shot_2015-12-16_at_22.19.35.png)


See merge request !2128
2015-12-16 22:44:52 +00:00
Douwe Maan 6493fd3d58 Move MR Builds tab next to Commits 2015-12-16 22:18:19 +01:00
Douwe Maan 2d0f9dd02e Fix merge widget JS for buttons 2015-12-16 19:53:38 +01:00
Douwe Maan 76708c2c18 Merge branch 'master' into fix-merge-immediately-button 2015-12-16 19:43:52 +01:00
Douwe Maan 8eb51dc037 Fix updating and disabling merge button when Merge Immediately is clicked 2015-12-16 19:27:46 +01:00
Dmitriy Zaporozhets 7070942521 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-12-16 19:19:25 +01:00
Dmitriy Zaporozhets 664384e78b Merge remote-tracking branch 'origin/rs-simplify-status-icon'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-16 19:19:07 +01:00
Dmitriy Zaporozhets 6374bdb352 Merge branch 'mr-builds-fixes' into 'master'
Link to correct (source) project on MR builds tab

Used to link to `gitlab-org/gitlab-ce/commits/<branch-name>`, now links to correct project.

See merge request !2115
2015-12-16 18:16:03 +00:00
Dmitriy Zaporozhets 3321f694b8 Merge branch 'fix-milestone-snippet-header' into 'master'
Fix headers of milestone and snippet show pages

Fix layout, and move "Edit" button to very right just like issue/MR.

Before:

![Screen_Shot_2015-12-15_at_17.33.20](/uploads/dbbeb6868b80e21894159126a0feca6a/Screen_Shot_2015-12-15_at_17.33.20.png)

![Screen_Shot_2015-12-15_at_17.33.28](/uploads/53d10b42adc34e48b063889120e9a746/Screen_Shot_2015-12-15_at_17.33.28.png)

After:

![Screen_Shot_2015-12-15_at_17.34.25](/uploads/b0d0ea3f6a7b61d51b474419207f7a02/Screen_Shot_2015-12-15_at_17.34.25.png)

![Screen_Shot_2015-12-15_at_17.35.55](/uploads/65b922f5249655d3733740690577c9d7/Screen_Shot_2015-12-15_at_17.35.55.png)

cc @skyruler 

cc @rspeicher 8.3 please!

See merge request !2104
2015-12-16 17:59:28 +00:00
Robert Speicher e27db8694c Merge branch 'reference-cache' into 'master'
Only cache markdown when object has been saved and has a proper cache_key.

See merge request !2119
2015-12-16 17:58:14 +00:00
Robert Speicher b5230bbe7c Merge branch 'fix-merge-immediately' into 'master'
Fix 'Merge Immediately' button

Fixes #4125

See merge request !2117
2015-12-16 17:51:25 +00:00
Douwe Maan 6ea26ae623 Only cache markdown when object has been saved and has a proper cache_key. 2015-12-16 18:36:14 +01:00
Douwe Maan 4dfd4e0366 Merge branch 'fix-bad-merge' into 'master'
Fix bad merge

/cc: @dzaporozhets 

See merge request !2116
2015-12-16 16:48:30 +00:00
Douwe Maan 9908da17c1 Merge branch 'fix-endpoint-not-setting-var' into 'master'
Fix endpoint not setting needed @ci_commit

/cc @DouweM

See merge request !2112
2015-12-16 16:39:35 +00:00
Douwe Maan 5843d09f07 Fix 'Merge Immediately' button 2015-12-16 17:38:58 +01:00
Dmitriy Zaporozhets 747f0a328c Merge branch 'control-list-right-margin' into 'master'
Fix right margin of control list

Before:

![Screen_Shot_2015-12-16_at_16.29.39](/uploads/7a6aa79b6af0900d9257ce86ab822a22/Screen_Shot_2015-12-16_at_16.29.39.png)

After:

![Screen_Shot_2015-12-16_at_16.29.45](/uploads/d52fdc70ecd63fc61ae6ae87b3b7d1a5/Screen_Shot_2015-12-16_at_16.29.45.png)


See merge request !2114
2015-12-16 16:07:06 +00:00
Stan Hu 02f5673171 Fix bad merge 2015-12-16 08:02:28 -08:00
Dmitriy Zaporozhets 28832fef7c Merge branch 'issuable-sidebar' into 'master'
Issuable sidebar tweaks

- Move cross-project reference down 
- ~~Fix "Notifications" label color~~ Reverted
- ~~Use regularly colored button for "Subscribe"/"Unsubscribe"~~ Reverted

Before:

![Screen_Shot_2015-12-15_at_17.38.08](/uploads/d4eeab44bb21fca2fe9ebe620ed9e060/Screen_Shot_2015-12-15_at_17.38.08.png)

After:

(Only the moved cross-project reference is still relevant, other changes have been reverted)

![Screen_Shot_2015-12-15_at_17.38.23](/uploads/b61aed3a0884c986785a5b09af8dbb25/Screen_Shot_2015-12-15_at_17.38.23.png)

cc @skyruler 

cc @rspeicher 8.3 please!

See merge request !2105
2015-12-16 15:54:10 +00:00
Douwe Maan 5fc90eec50 Link to correct (source) project on MR builds tab 2015-12-16 16:47:39 +01:00
Dmitriy Zaporozhets fa4545e3f9 Merge branch 'fix-border' into 'master'
Fix double right border in MR discussion

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

# Before
![Screenshot_2015-12-16_15.44.00](/uploads/dd2c85e82fdb784e897cf1a695af1a1e/Screenshot_2015-12-16_15.44.00.png)

# After
![Screenshot_2015-12-16_15.43.36](/uploads/b50954e01bb3f45d2df6f43d34a1db60/Screenshot_2015-12-16_15.43.36.png)

cc @skyruler 

See merge request !2113
2015-12-16 15:46:18 +00:00
Douwe Maan d8978acd39 Fix right margin of control list 2015-12-16 16:30:01 +01:00
Douwe Maan ff16ee63e6 Revert "Fix "Notifications" label color"
This reverts commit e4e1777aa5.
2015-12-16 16:23:31 +01:00
Douwe Maan f4c94e1fd6 Revert "Use regularly colored button for "Subscribe"/"Unsubscribe""
This reverts commit c1db8d1590.
2015-12-16 16:23:18 +01:00
Douwe Maan 79c90821ac Rename .issuable-details to .detail-page (and -header and -description) 2015-12-16 16:13:22 +01:00
Dmitriy Zaporozhets c21cd0ba1f Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-12-16 16:09:09 +01:00
Dmitriy Zaporozhets b8570576e8 Merge branch 'add-open-issues-count-to-api' of https://gitlab.com/stanhu/gitlab-ce
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-16 16:08:35 +01:00
Douwe Maan 41d6b3701e Merge branch 'master' into fix-milestone-snippet-header 2015-12-16 15:56:23 +01:00
Dmitriy Zaporozhets 9472d1372f Fix double border in MR discussion
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-16 15:41:50 +01:00
Zeger-Jan van de Weg 95c03f245f Fix endpoint not setting needed @ci_commit 2015-12-16 15:20:53 +01:00
Douwe Maan d60047bb31 Merge branch 'remove-author-from-email' into 'master'
Revert "Make sure notify email always has author info."

This reverts commit 303f79f804.

See merge request !2103
2015-12-16 13:51:45 +00:00
Dmitriy Zaporozhets a1fd87cddb Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-12-16 14:37:04 +01:00
Douwe Maan e07c9c1ee1 Merge branch 'rs-clipboard-fixes' into 'master'
Fix clipboard buttons on MR instructions and Commit#show



See merge request !2108
2015-12-16 13:30:15 +00:00
Dmitriy Zaporozhets a9d19fa8ef Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-12-16 14:24:32 +01:00
Douwe Maan 8e9f740d08 Merge branch 'rs-timeago' into 'master'
Fix time_ago_with_tooltip for activity feed

Closes #4002

See merge request !2074
2015-12-16 13:07:06 +00:00
Dmitriy Zaporozhets 259a7d7ba5 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-12-16 13:45:14 +01:00
Dmitriy Zaporozhets 40104746d6 Merge remote-tracking branch 'origin/feature/update-rubocop' 2015-12-16 13:44:50 +01:00
Andrey 37a4e4945d Merge branch 'fix-profile-nav' into 'master'
Make profile navigation full wide

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

## Before


![Administrator___GitLab](/uploads/a43e8992264ed78afa732e7a911ef154/Administrator___GitLab.png)

## After

![Administrator___GitLab1](/uploads/9e67e8af071d4879045311abe15a7bba/Administrator___GitLab1.png)

See merge request !2076
2015-12-16 10:57:02 +00:00
Robert Speicher f49ac5c8d3 Fix clipboard buttons on MR instructions and Commit#show 2015-12-15 16:11:01 -05:00
Robert Speicher 5ffed49fef Merge branch 'lazy-reference-extractor' into 'master'
Move Markdown/reference logic from `Gitlab::Markdown` to `Banzai`

- Moves from `Gitlab::Markdown` to `Banzai`
- Moves filters and pipelines into their own namespace: `Banzai::Filter` and `Banzai::Pipeline`
- No more `autoload`!
- Split up `Gitlab::ReferenceExtractor` into `Banzai::ReferenceExtractor` and `Gitlab::ReferenceExtractor`
- Replace `something(load_lazy_references: true)` by `Gitlab::ReferenceExtractor.lazily { something }`

Goes from:

```ruby
def referenced_merge_requests
  references = [self, *notes].flat_map do |note|
    note.all_references(load_lazy_references: false).merge_requests
  end.uniq!

  Gitlab::Markdown::ReferenceFilter::LazyReference.load(references).uniq.sort_by(&:iid)
end
```

to

```ruby
def referenced_merge_requests
  Gitlab::ReferenceExtractor.lazily do
    [self, *notes].flat_map do |note|
      note.all_references.merge_requests
    end
  end.sort_by(&:iid)
end
```

See merge request !2027
2015-12-15 20:52:04 +00:00
Gabriel Mazetto 9072098215 Fixed CiServices validation 2015-12-15 17:37:23 -02:00
Andrey 96a1558897 Merge branch 'wider-layout' into 'master'
Increase fixed layout width to 1280px

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

cc @creamzy 

See merge request !2075
2015-12-15 18:19:55 +00:00
Douwe Maan 9dfe43c83b Move milestone edit button to the very right 2015-12-15 17:36:08 +01:00
Douwe Maan c1db8d1590 Use regularly colored button for "Subscribe"/"Unsubscribe" 2015-12-15 17:33:03 +01:00
Douwe Maan e4e1777aa5 Fix "Notifications" label color 2015-12-15 17:32:46 +01:00
Douwe Maan 297398ea32 Move cross-project reference down 2015-12-15 17:32:37 +01:00