Commit graph

18 commits

Author SHA1 Message Date
Sarah Yasonik
e6fcdd7aca Update Metrics references to Object path
On reload, references to Metrics within classes in the Gitlab::Metrics
module fail. Update all references to ::Gitlab::Metrics so that
constant lookup finds the right module in development. This fix should
not impact production.
2019-02-14 18:05:35 +00:00
Ben Kochie
54438ad04b
Clean up unicorn sampler metric labels
Change `type` and `address` labels to be less generic to avoid conflicts
with other systems.
2019-02-06 14:19:51 +01:00
gfyoung
7ec8af5017 Enable even more frozen string for lib/gitlab
Enables frozen string for the following:

* lib/gitlab/hook_data/**/*.rb
* lib/gitlab/i18n/**/*.rb
* lib/gitlab/import/**/*.rb
* lib/gitlab/import_export/**/*.rb
* lib/gitlab/kubernetes/**/*.rb
* lib/gitlab/legacy_github_import/**/*.rb
* lib/gitlab/manifest_import/**/*.rb
* lib/gitlab/metrics/**/*.rb
* lib/gitlab/middleware/**/*.rb

Partially addresses gitlab-org/gitlab-ce#47424.
2018-11-16 17:41:14 -08:00
Ben Kochie
78a9991543
Cleanup ruby sampler metrics
* Use a simple counter for sampler duration instead of a histogram.
* Use a counter to collect GC time.
* Remove unused objects metric.
* Cleanup metric names to match Prometheus conventions.
* Prefix generic GC stats with `gc_stat`.
* Include worker label on memory and file descriptor metrics.
2018-06-22 14:12:22 +02:00
Yorick Peterse
d527b46802
Remove remaining traces of the Allocations Gem
In MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15834 we
removed use of the data produced by the Allocations Gem. However, we
never removed the code that just enables tracking of allocations. In
this commit we remove all remaining traces of this Gem.
2018-06-20 15:11:10 +02:00
Pawel Chojnacki
a8ebed6016 Make System.monotonic_time retun seconds represented by float with microsecond precision 2017-12-12 18:12:49 +01:00
Stan Hu
10f5446c33 Remove RubySampler#sample_objects for performance as well 2017-12-11 06:55:59 -08:00
Stan Hu
e1a8e5a509 Remove allocation tracking code from InfluxDB sampler for performance
On GitLab.com, InfluxSampler#sample_objects appears to take 1.2 s or so to
iterate through 1059 objects. This had led to delays of a couple hundred
milliseconds in processing in the main thread. Remove this code since it's not
really being used.

Closes gitlab-com/infrastructure#3250
2017-12-10 21:53:28 -08:00
Pawel Chojnacki
ee22a47d62 Update prometheus-client-mmap gem to highly optimized version
+ change string concatenation to help with GC pressure.
+ fix metric producing incompatible label sets
2017-12-07 17:47:23 +01:00
Jacopo
181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Pawel Chojnacki
043545de3a Remove unnecessary namespace use 2017-11-02 18:11:44 +01:00
Pawel Chojnacki
547dd817a5 Fix rubocop warnings 2017-11-02 18:11:43 +01:00
Pawel Chojnacki
3cc28601f3 Cleanup sampling code and fix bug with samplers running without sleep 2017-11-02 18:10:57 +01:00
Pawel Chojnacki
b6d75b2955 remove common Base Sampler code 2017-11-02 18:10:57 +01:00
Pawel Chojnacki
3b1464803b Transaction and method instrumentation 2017-11-02 18:10:42 +01:00
Pawel Chojnacki
4c04444e22 Finished Ruby Sampler
+ Cleanup sampler, use latest Prometheus gem
2017-11-02 18:10:20 +01:00
Pawel Chojnacki
0bfe79019d Add samples total and cleanup 2017-11-02 18:09:21 +01:00
Pawel Chojnacki
03b38a4a8d Add GC sampler and small refactor of samplers 2017-11-02 18:09:21 +01:00