Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gitlab-exporter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gitlab-org
gitlab-exporter
Commits
e7ab273d
Unverified
Commit
e7ab273d
authored
Oct 31, 2019
by
Ben Kochie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure database metrics are added as floats.
parent
7c3b159a
Pipeline
#134341
failed with stage
in 53 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
lib/gitlab_exporter/database/bloat.rb
lib/gitlab_exporter/database/bloat.rb
+1
-1
lib/gitlab_exporter/database/ci_builds.rb
lib/gitlab_exporter/database/ci_builds.rb
+5
-5
lib/gitlab_exporter/database/remote_mirrors.rb
lib/gitlab_exporter/database/remote_mirrors.rb
+2
-2
lib/gitlab_exporter/database/row_count.rb
lib/gitlab_exporter/database/row_count.rb
+1
-1
lib/gitlab_exporter/database/tuple_stats.rb
lib/gitlab_exporter/database/tuple_stats.rb
+1
-1
No files found.
lib/gitlab_exporter/database/bloat.rb
View file @
e7ab273d
...
...
@@ -60,7 +60,7 @@ module GitLab
def
probe_for_type
(
type
)
collector
.
run
(
type
).
each
do
|
query_name
,
data
|
METRIC_KEYS
.
each
do
|
key
|
metrics
.
add
(
"gitlab_database_bloat_
#{
type
}
_
#{
key
}
"
,
data
[
key
],
query_name:
query_name
)
metrics
.
add
(
"gitlab_database_bloat_
#{
type
}
_
#{
key
}
"
,
data
[
key
]
.
to_f
,
query_name:
query_name
)
end
end
...
...
lib/gitlab_exporter/database/ci_builds.rb
View file @
e7ab273d
...
...
@@ -463,7 +463,7 @@ module GitLab
other_values
[
key
]
||=
0
other_values
[
key
]
+=
metric
[
:value
]
else
add_ci_created_pending_builds
(
metric_name
,
metric
[
:value
],
metric
)
add_ci_created_pending_builds
(
metric_name
,
metric
[
:value
]
.
to_f
,
metric
)
end
end
...
...
@@ -479,7 +479,7 @@ module GitLab
end
def
ci_stale_builds_metrics
@metrics
.
add
(
"ci_stale_builds"
,
@results
[
:stale_builds
])
@metrics
.
add
(
"ci_stale_builds"
,
@results
[
:stale_builds
]
.
to_f
)
end
def
metrics_per_runner
...
...
@@ -519,19 +519,19 @@ module GitLab
labels
[
:namespace
]
=
""
unless
labels
[
:namespace
]
selected_labels
=
labels
.
select
{
|
k
,
_
|
allowed_labels
.
include?
(
k
)
}.
sort
.
to_h
@metrics
.
add
(
metric_name
,
value
,
selected_labels
)
@metrics
.
add
(
metric_name
,
value
.
to_f
,
selected_labels
)
end
def
repeated_commands_metrics
@results
[
:repeated_commands
].
each
do
|
metric
|
value
=
metric
.
delete
(
:value
)
@metrics
.
add
(
"ci_repeated_commands_builds"
,
value
,
metric
)
@metrics
.
add
(
"ci_repeated_commands_builds"
,
value
.
to_f
,
metric
)
end
end
def
unarchived_traces_metrics
@metrics
.
add
(
"ci_unarchived_traces"
,
@results
[
:unarchived_traces
])
@metrics
.
add
(
"ci_unarchived_traces"
,
@results
[
:unarchived_traces
]
.
to_f
)
end
end
end
...
...
lib/gitlab_exporter/database/remote_mirrors.rb
View file @
e7ab273d
...
...
@@ -48,13 +48,13 @@ module GitLab
results
.
to_a
.
each
do
|
row
|
@metrics
.
add
(
"project_remote_mirror_last_successful_update_time_seconds"
,
row
[
"last_successful_update_at"
].
to_
i
,
row
[
"last_successful_update_at"
].
to_
f
,
project_id:
row
[
"project_id"
],
url:
row
[
"url"
]
)
@metrics
.
add
(
"project_remote_mirror_last_update_time_seconds"
,
row
[
"last_update_at"
].
to_
i
,
row
[
"last_update_at"
].
to_
f
,
project_id:
row
[
"project_id"
],
url:
row
[
"url"
]
)
...
...
lib/gitlab_exporter/database/row_count.rb
View file @
e7ab273d
...
...
@@ -147,7 +147,7 @@ module GitLab
def
probe_db
results
=
@collector
.
run
results
.
each
do
|
key
,
value
|
@metrics
.
add
(
"gitlab_database_rows"
,
value
.
to_
i
,
query_name:
key
.
to_s
)
@metrics
.
add
(
"gitlab_database_rows"
,
value
.
to_
f
,
query_name:
key
.
to_s
)
end
self
...
...
lib/gitlab_exporter/database/tuple_stats.rb
View file @
e7ab273d
...
...
@@ -36,7 +36,7 @@ module GitLab
result
.
each
do
|
table_name
,
tuple_stats
|
tuple_stats
.
each
do
|
column_name
,
value
|
@metrics
.
add
(
"gitlab_database_stat_table_
#{
column_name
}
"
,
value
,
value
.
to_f
,
table_name:
table_name
)
unless
value
.
is_a?
(
Numeric
)
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