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
7705e44e
Commit
7705e44e
authored
Jun 10, 2020
by
nmilojevic1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Mr comments
parent
cca79cd2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
4 deletions
+11
-4
lib/gitlab/metrics/elasticsearch_rack_middleware.rb
lib/gitlab/metrics/elasticsearch_rack_middleware.rb
+1
-0
lib/gitlab/metrics/method_call.rb
lib/gitlab/metrics/method_call.rb
+5
-1
lib/gitlab/metrics/redis_rack_middleware.rb
lib/gitlab/metrics/redis_rack_middleware.rb
+1
-0
lib/gitlab/metrics/subscribers/action_view.rb
lib/gitlab/metrics/subscribers/action_view.rb
+1
-0
lib/gitlab/metrics/subscribers/rails_cache.rb
lib/gitlab/metrics/subscribers/rails_cache.rb
+2
-0
spec/lib/gitlab/git/blob_spec.rb
spec/lib/gitlab/git/blob_spec.rb
+1
-1
spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb
.../lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb
+0
-2
No files found.
lib/gitlab/metrics/elasticsearch_rack_middleware.rb
View file @
7705e44e
...
...
@@ -27,6 +27,7 @@ module Gitlab
transaction
.
increment
(
:http_elasticsearch_requests_total
,
request_count
)
do
docstring
'Amount of calls to Elasticsearch servers during web requests'
end
transaction
.
observe
(
:http_elasticsearch_requests_duration_seconds
,
query_time
)
do
docstring
'Query time for Elasticsearch servers during web requests'
buckets
HISTOGRAM_BUCKETS
...
...
lib/gitlab/metrics/method_call.rb
View file @
7705e44e
...
...
@@ -4,7 +4,7 @@ module Gitlab
module
Metrics
# Class for tracking timing information about method calls
class
MethodCall
attr_reader
:real_time
,
:cpu_time
,
:call_count
,
:labels
,
:transaction
attr_reader
:real_time
,
:cpu_time
,
:call_count
# name - The full name of the method (including namespace) such as
# `User#sign_in`.
...
...
@@ -50,6 +50,10 @@ module Gitlab
def
above_threshold?
real_time
.
in_milliseconds
>=
::
Gitlab
::
Metrics
.
method_call_threshold
end
private
attr_reader
:labels
,
:transaction
end
end
end
lib/gitlab/metrics/redis_rack_middleware.rb
View file @
7705e44e
...
...
@@ -25,6 +25,7 @@ module Gitlab
transaction
.
increment
(
:http_redis_requests_total
,
request_count
)
do
docstring
'Amount of calls to Redis servers during web requests'
end
transaction
.
observe
(
:http_redis_requests_duration_seconds
,
query_time
)
do
docstring
'Query time for Redis servers during web requests'
buckets
Gitlab
::
Instrumentation
::
Redis
::
QUERY_TIME_BUCKETS
...
...
lib/gitlab/metrics/subscribers/action_view.rb
View file @
7705e44e
...
...
@@ -25,6 +25,7 @@ module Gitlab
buckets
[
0.001
,
0.01
,
0.1
,
1
,
10.0
]
with_feature
:prometheus_metrics_view_instrumentation
end
current_transaction
.
increment
(
:gitlab_transaction_view_duration_total
,
event
.
duration
)
end
...
...
lib/gitlab/metrics/subscribers/rails_cache.rb
View file @
7705e44e
...
...
@@ -45,6 +45,7 @@ module Gitlab
current_transaction
.
increment
(
:gitlab_cache_misses_total
,
1
)
do
docstring
'Cache read miss'
end
current_transaction
.
increment
(
:gitlab_transaction_cache_read_miss_count_total
,
1
)
end
...
...
@@ -56,6 +57,7 @@ module Gitlab
docstring
'Cache operations'
base_labels
labels
end
current_transaction
.
observe
(
:gitlab_cache_operation_duration_seconds
,
duration
/
1000.0
)
do
docstring
'Cache access time'
buckets
[
0.00001
,
0.0001
,
0.001
,
0.01
,
0.1
,
1.0
]
...
...
spec/lib/gitlab/git/blob_spec.rb
View file @
7705e44e
...
...
@@ -45,7 +45,7 @@ RSpec.describe Gitlab::Git::Blob, :seed_helper do
blob
end
it
'increment :gitlab_blob_truncated_false counter'
do
it
'increment
s
:gitlab_blob_truncated_false counter'
do
expect
(
transaction
)
.
to
receive
(
:increment
).
with
(
:gitlab_blob_truncated_false
)
...
...
spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb
View file @
7705e44e
...
...
@@ -9,8 +9,6 @@ RSpec.describe Gitlab::Metrics::ElasticsearchRackMiddleware do
let
(
:transaction
)
{
Gitlab
::
Metrics
::
WebTransaction
.
new
(
env
)
}
describe
'#call'
do
# let(:counter) { instance_double(Prometheus::Client::Counter, increment: nil) }
# let(:histogram) { instance_double(Prometheus::Client::Histogram, observe: nil) }
let
(
:elasticsearch_query_time
)
{
0.1
}
let
(
:elasticsearch_requests_count
)
{
2
}
...
...
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