From 81d8ddf8cad78097cfba503553f879eb76c2485f Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 10 Jul 2018 15:59:00 +0200 Subject: [PATCH] Add a 10 ms bucket for SQL timings This allows us to calculate quantiles of SQL timings more accurately, instead of a lot of timings being assigned to the 50 ms bucket. --- changelogs/unreleased/tweak-sql-buckets.yml | 5 +++++ lib/gitlab/metrics/subscribers/active_record.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/tweak-sql-buckets.yml diff --git a/changelogs/unreleased/tweak-sql-buckets.yml b/changelogs/unreleased/tweak-sql-buckets.yml new file mode 100644 index 00000000000..00a0f733ee1 --- /dev/null +++ b/changelogs/unreleased/tweak-sql-buckets.yml @@ -0,0 +1,5 @@ +--- +title: Add a 10 ms bucket for SQL timings +merge_request: +author: +type: changed diff --git a/lib/gitlab/metrics/subscribers/active_record.rb b/lib/gitlab/metrics/subscribers/active_record.rb index 38f119cf06d..c205f348023 100644 --- a/lib/gitlab/metrics/subscribers/active_record.rb +++ b/lib/gitlab/metrics/subscribers/active_record.rb @@ -20,7 +20,7 @@ module Gitlab define_histogram :gitlab_sql_duration_seconds do docstring 'SQL time' base_labels Transaction::BASE_LABELS - buckets [0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0] + buckets [0.01, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0] end def current_transaction