Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cfbc15af
Commit
cfbc15af
authored
Mar 08, 2021
by
Quang-Minh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a changelog entry
parent
79103a95
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
changelogs/unreleased/323163-restore-gitlab_database_transaction_seconds_sum-for-sidekiq.yml
...e-gitlab_database_transaction_seconds_sum-for-sidekiq.yml
+5
-0
lib/gitlab/metrics/subscribers/active_record.rb
lib/gitlab/metrics/subscribers/active_record.rb
+3
-2
spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
+1
-1
No files found.
changelogs/unreleased/323163-restore-gitlab_database_transaction_seconds_sum-for-sidekiq.yml
0 → 100644
View file @
cfbc15af
---
title
:
Port essential database metrics to Sidekiq
merge_request
:
56005
author
:
type
:
changed
lib/gitlab/metrics/subscribers/active_record.rb
View file @
cfbc15af
...
@@ -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
...
...
spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
View file @
cfbc15af
...
@@ -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
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment