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
0157e552
Commit
0157e552
authored
Mar 18, 2021
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report summarized Gitaly Apdex via usage ping
Fetches average 1 week apdex from prometheus
parent
8b407f0a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
1 deletion
+62
-1
changelogs/unreleased/gitaly_usage_data_apdex.yml
changelogs/unreleased/gitaly_usage_data_apdex.yml
+5
-0
config/metrics/settings/20210321224827_gitaly_apdex.yml
config/metrics/settings/20210321224827_gitaly_apdex.yml
+20
-0
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+12
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+12
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+13
-0
No files found.
changelogs/unreleased/gitaly_usage_data_apdex.yml
0 → 100644
View file @
0157e552
---
title
:
Report summarized Gitaly Apdex via usage ping
merge_request
:
47040
author
:
type
:
added
config/metrics/settings/20210321224827_gitaly_apdex.yml
0 → 100644
View file @
0157e552
---
key_path
:
settings.gitaly_apdex
description
:
Gitaly application performance
product_section
:
dev
product_stage
:
create
product_group
:
group::gitaly
product_category
:
gitaly
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47040
time_frame
:
none
data_source
:
prometheus
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
doc/development/usage_ping/dictionary.md
View file @
0157e552
...
@@ -14360,6 +14360,18 @@ Status: `data_available`
...
@@ -14360,6 +14360,18 @@ Status: `data_available`
Tiers:
`free`
,
`premium`
,
`ultimate`
Tiers:
`free`
,
`premium`
,
`ultimate`
### `settings.gitaly_apdex`
Gitaly application performance
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/settings/20210321224827_gitaly_apdex.yml
)
Group:
`group::gitaly`
Status:
`implemented`
Tiers:
`free`
,
`premium`
,
`ultimate`
### `settings.ldap_encrypted_secrets_enabled`
### `settings.ldap_encrypted_secrets_enabled`
Is encrypted LDAP secrets configured?
Is encrypted LDAP secrets configured?
...
...
lib/gitlab/usage_data.rb
View file @
0157e552
...
@@ -243,7 +243,8 @@ module Gitlab
...
@@ -243,7 +243,8 @@ module Gitlab
{
{
settings:
{
settings:
{
ldap_encrypted_secrets_enabled:
alt_usage_data
(
fallback:
nil
)
{
Gitlab
::
Auth
::
Ldap
::
Config
.
encrypted_secrets
.
active?
},
ldap_encrypted_secrets_enabled:
alt_usage_data
(
fallback:
nil
)
{
Gitlab
::
Auth
::
Ldap
::
Config
.
encrypted_secrets
.
active?
},
operating_system:
alt_usage_data
(
fallback:
nil
)
{
operating_system
}
operating_system:
alt_usage_data
(
fallback:
nil
)
{
operating_system
},
gitaly_apdex:
alt_usage_data
{
gitaly_apdex
}
}
}
}
}
end
end
...
@@ -767,6 +768,16 @@ module Gitlab
...
@@ -767,6 +768,16 @@ module Gitlab
private
private
def
gitaly_apdex
with_prometheus_client
(
verify:
false
,
fallback:
FALLBACK
)
do
|
client
|
result
=
client
.
query
(
'avg_over_time(gitlab_usage_ping:gitaly_apdex:ratio_avg_over_time_5m[1w])'
).
first
break
FALLBACK
unless
result
result
[
'value'
].
last
.
to_f
end
end
def
aggregated_metrics
def
aggregated_metrics
@aggregated_metrics
||=
::
Gitlab
::
Usage
::
Metrics
::
Aggregates
::
Aggregate
.
new
(
recorded_at
)
@aggregated_metrics
||=
::
Gitlab
::
Usage
::
Metrics
::
Aggregates
::
Aggregate
.
new
(
recorded_at
)
end
end
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
0157e552
...
@@ -1158,8 +1158,17 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
...
@@ -1158,8 +1158,17 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
".system_usage_data_settings"
do
describe
".system_usage_data_settings"
do
let
(
:prometheus_client
)
{
double
(
Gitlab
::
PrometheusClient
)
}
before
do
before
do
allow
(
described_class
).
to
receive
(
:operating_system
).
and_return
(
'ubuntu-20.04'
)
allow
(
described_class
).
to
receive
(
:operating_system
).
and_return
(
'ubuntu-20.04'
)
expect
(
prometheus_client
).
to
receive
(
:query
).
with
(
/gitlab_usage_ping:gitaly_apdex:ratio_avg_over_time_5m/
).
and_return
([
{
'metric'
=>
{},
'value'
=>
[
1616016381.473
,
'0.95'
]
}
])
expect
(
described_class
).
to
receive
(
:with_prometheus_client
).
and_yield
(
prometheus_client
)
end
end
subject
{
described_class
.
system_usage_data_settings
}
subject
{
described_class
.
system_usage_data_settings
}
...
@@ -1171,6 +1180,10 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
...
@@ -1171,6 +1180,10 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
it
'populates operating system information'
do
it
'populates operating system information'
do
expect
(
subject
[
:settings
][
:operating_system
]).
to
eq
(
'ubuntu-20.04'
)
expect
(
subject
[
:settings
][
:operating_system
]).
to
eq
(
'ubuntu-20.04'
)
end
end
it
'gathers gitaly apdex'
,
:aggregate_failures
do
expect
(
subject
[
:settings
][
:gitaly_apdex
]).
to
be_within
(
0.001
).
of
(
0.95
)
end
end
end
end
end
...
...
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