Commit Graph

21 Commits

Author SHA1 Message Date
Thong Kuah 8c42a0eac0 Add frozen_string_literal to lib part 2
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-08-23 00:15:24 +12:00
Pawel Chojnacki 7772dfb788 before -> after 2018-01-29 15:13:05 +01:00
Pawel Chojnacki 66c1acba0b Fix code after refactoring 2018-01-29 15:13:03 +01:00
Pawel Chojnacki d97548daa8 cleanup method call 2018-01-29 15:13:03 +01:00
Douwe Maan 92e15071c1 Merge branch 'pawel/reduce_cardinality_of_prometheus_metrics' into 'master'
Reduce cardinality of some of GitLab's Prometheus metrics and fix observed duration reporting.

Closes #41045

See merge request gitlab-org/gitlab-ce!15881
2017-12-21 15:56:45 +00:00
Pawel Chojnacki 040167f072 Use seconds where possible, and convert to milliseconds for Influxdb consumption 2017-12-21 00:39:52 +01:00
Pawel Chojnacki 3c545133e8 Fix tests and formatting 2017-12-19 17:45:25 +01:00
Pawel Chojnacki db9e5bf75e fix test case description 2017-12-13 18:43:08 +01:00
Pawel Chojnacki da19ce625b Expire feature flag cache after 1minute 2017-12-12 18:52:08 +01:00
Pawel Chojnacki fd0a516854 use class variables instead of CONSTANTs 2017-12-12 18:38:28 +01:00
Pawel Chojnacki 408208bc2b Use AtomicFixNum to implement CAS isolated cache update.
i.e.
Using compare and swap we update the expires_at value.
The thread that actually is able to update this value will also set
the cache holding method_call enabled state
2017-12-12 18:38:28 +01:00
Pawel Chojnacki 5904b033db Implemente measurement enabled cache using AtomicReference 2017-12-12 18:38:28 +01:00
Pawel Chojnacki b503e6ff42 Implement simple in memory cache that expires after 5 minutes 2017-12-12 18:38:28 +01:00
Pawel Chojnacki 53dc9e83c3 Cache feature check for 5 minutes for MethodCall instrumentation toggle 2017-12-12 18:38:28 +01:00
Pawel Chojnacki 46cd2d93bb Use feature flag instead of application settigns to control if method calls should be instrumented 2017-11-23 23:39:10 +01:00
Pawel Chojnacki 0051b5fbcc Use only real duration to measure method call performance via Prometheus 2017-11-23 23:33:01 +01:00
Pawel Chojnacki efe4cab92b check method timing threshold when observing method performance 2017-11-23 23:33:01 +01:00
Pawel Chojnacki b90bf88b14 Fix rspec errors, and add more tests to MethodCall and ActionView 2017-11-02 18:11:43 +01:00
Douwe Maan f72a65603d Fix another spec 2017-02-23 09:31:57 -06:00
Douwe Maan 3a8128f199 Enable Lint/UnifiedInteger 2017-02-23 09:31:57 -06:00
Yorick Peterse be3b878443 Track method call times/counts as a single metric
Previously we'd create a separate Metric instance for every method call
that would exceed the method call threshold. This is problematic because
it doesn't provide us with information to accurately get the _total_
execution time of a particular method. For example, if the method
"Foo#bar" was called 4 times with a runtime of ~10 milliseconds we'd end
up with 4 different Metric instances. If we were to then get the
average/95th percentile/etc of the timings this would be roughly 10
milliseconds. However, the _actual_ total time spent in this method
would be around 40 milliseconds.

To solve this problem we now create a single Metric instance per method.
This Metric instance contains the _total_ real/CPU time and the call
count for every instrumented method.
2016-06-17 13:09:55 -04:00