Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gitlab-org
gitlab-exporter
Commits
189194b3
Commit
189194b3
authored
Nov 14, 2016
by
Ahmad Sherif
Browse files
Count git process count manually
parent
93d3e26e
Pipeline
#23616
passed with stage
in 1 minute and 33 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Gemfile.lock
View file @
189194b3
PATH
remote: .
specs:
gitlab-monitor (0.0.1
5
)
gitlab-monitor (0.0.1
6
)
pg (~> 0.18.4)
quantile (~> 0.2.0)
redis-namespace (~> 1.5.2)
...
...
lib/gitlab_monitor/git.rb
View file @
189194b3
...
...
@@ -91,14 +91,19 @@ module GitLab
end
def
probe_git
# rubocop:disable Metrics/MethodLength
counts
=
Hash
.
new
(
0
)
Utils
.
pgrep
(
"^git "
).
each
do
|
pid
|
process_cmd
=
File
.
read
(
"/proc/
#{
pid
}
/cmdline"
)
subcommand
=
self
.
class
.
extract_subcommand
(
process_cmd
)
next
unless
subcommand
# Unlikely, but just to be safe
name
=
"git
#{
subcommand
}
"
counts
[
name
]
+=
1
prober
=
ProcessProber
.
new
(
{
name:
"git
#{
subcommand
}
"
,
name:
name
,
pid_or_pattern:
pid
,
quantiles:
@opts
[
:quantiles
]
},
...
...
@@ -108,7 +113,10 @@ module GitLab
prober
.
probe_memory
.
probe_age
.
probe_count
end
counts
.
each
do
|
name
,
count
|
@metrics
.
add
(
"process_count"
,
count
,
name:
name
)
end
self
...
...
lib/gitlab_monitor/version.rb
View file @
189194b3
module
GitLab
module
Monitor
VERSION
=
"0.0.1
5
"
.
freeze
VERSION
=
"0.0.1
6
"
.
freeze
end
end
Write
Preview
Supports
Markdown
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