Skip to content

Commit

Permalink
Remove stale mem_info function
Browse files Browse the repository at this point in the history
This used to be at least occasionally updated in aebdc2e,
in 7239fba it got removed

The user is required to call refresh themselves in order to not get stale
results after first access
  • Loading branch information
Earlopain committed May 9, 2024
1 parent 37a0f9d commit f430b7a
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 f430b7a

Please sign in to comment.