Class: GitLab::Monitor::MemStats::Aggregator

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab_monitor/memstats.rb

Overview

Aggregates all metrics for a single PID in /proc/<pid>/smaps

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pid) ⇒ Aggregator

Returns a new instance of Aggregator.


35
36
37
38
39
40
41
42
# File 'lib/gitlab_monitor/memstats.rb', line 35

def initialize(pid)
  @pid = pid
  @totals = Hash.new(0)
  @mappings = []
  @valid = true

  populate_info
end

Instance Attribute Details

#pidObject

Returns the value of attribute pid


33
34
35
# File 'lib/gitlab_monitor/memstats.rb', line 33

def pid
  @pid
end

#totalsObject

Returns the value of attribute totals


33
34
35
# File 'lib/gitlab_monitor/memstats.rb', line 33

def totals
  @totals
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)

44
45
46
# File 'lib/gitlab_monitor/memstats.rb', line 44

def valid?
  @valid
end