Skip to content
Snippets Groups Projects
Commit 189194b3 authored by Ahmad Sherif's avatar Ahmad Sherif
Browse files

Count git process count manually

parent 93d3e26e
No related branches found
No related tags found
No related merge requests found
Pipeline #
PATH
remote: .
specs:
gitlab-monitor (0.0.15)
gitlab-monitor (0.0.16)
pg (~> 0.18.4)
quantile (~> 0.2.0)
redis-namespace (~> 1.5.2)
Loading
Loading
Loading
Loading
@@ -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]
},
Loading
Loading
@@ -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
Loading
Loading
module GitLab
module Monitor
VERSION = "0.0.15".freeze
VERSION = "0.0.16".freeze
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment