Commit cfbc15af authored by Quang-Minh Nguyen's avatar Quang-Minh Nguyen

Add a changelog entry

parent 79103a95
---
title: Port essential database metrics to Sidekiq
merge_request: 56005
author:
type: changed
...@@ -13,8 +13,9 @@ module Gitlab ...@@ -13,8 +13,9 @@ module Gitlab
DURATION_BUCKET = [0.05, 0.1, 0.25].freeze DURATION_BUCKET = [0.05, 0.1, 0.25].freeze
# observe_transaction_duration is called from ActiveRecordBaseTransactionMetrics.transaction and used to # This event is published from ActiveRecordBaseTransactionMetrics and
# record transaction durations. # used to record a database transaction duration when calling
# ActiveRecord::Base.transaction {} block.
def transaction(event) def transaction(event)
observe(:gitlab_database_transaction_seconds, event) observe(:gitlab_database_transaction_seconds, event)
end end
......
...@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActiveRecord do ...@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActiveRecord do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let(:env) { {} } let(:env) { {} }
let(:subscriber) { described_class.new } let(:subscriber) { described_class.new }
let(:connection) { double(:connection) } let(:connection) { double(:connection) }
let(:payload) { { sql: 'SELECT * FROM users WHERE id = 10', connection: connection } } let(:payload) { { sql: 'SELECT * FROM users WHERE id = 10', connection: connection } }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment