Skip to content

Commit

Permalink
Merge pull request #114 from Earlopain/stale-meminfo
Browse files Browse the repository at this point in the history
Remove stale mem_info function
  • Loading branch information
casperisfine committed May 9, 2024
2 parents c9a8a94 + f430b7a commit f693b46
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
13 changes: 0 additions & 13 deletions lib/pitchfork/children.rb
Expand Up @@ -17,11 +17,6 @@ def initialize
@pending_molds = {} # Worker promoted to mold, not yet acknowledged
end

def refresh
@workers.each_value(&:refresh)
@molds.each_value(&:refresh)
end

def register(child)
# Children always start as workers, never molds, so we know they have a `#nr`.
@pending_workers[child.nr] = @workers[child.nr] = child
Expand Down Expand Up @@ -154,13 +149,5 @@ def fresh_workers
def workers_count
@workers.size
end

def total_pss
total_pss = MemInfo.new(Process.pid).pss
@children.each do |_, worker|
total_pss += worker.meminfo.pss if worker.meminfo
end
total_pss
end
end
end
8 changes: 0 additions & 8 deletions lib/pitchfork/worker.rb
Expand Up @@ -32,14 +32,6 @@ def initialize(nr, pid: nil, generation: 0)
end
end

def meminfo
@meminfo ||= MemInfo.new(pid) if pid
end

def refresh
meminfo&.update
end

def exiting?
@exiting
end
Expand Down

0 comments on commit f693b46

Please sign in to comment.