Class: MemoryTracker::Stores::GcstatLogfileStore

Inherits:
Object
  • Object
show all
Defined in:
lib/memory_tracker/stores/gcstat_logfile_store.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger_class, logfile_path) ⇒ GcstatLogfileStore

Returns a new instance of GcstatLogfileStore.



4
5
6
7
# File 'lib/memory_tracker/stores/gcstat_logfile_store.rb', line 4

def initialize(logger_class, logfile_path)
  @logger = logger_class.new(logfile_path)
  @num_lines = 0
end

Instance Method Details

#nameObject



9
10
11
# File 'lib/memory_tracker/stores/gcstat_logfile_store.rb', line 9

def name
  :gcstat_logfile
end

#push(request) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/memory_tracker/stores/gcstat_logfile_store.rb', line 13

def push(request)
  @request = request

  write_header if @num_lines % 1000 == 0
  write_request_log
  @num_lines += 1
end

#statsObject



21
22
# File 'lib/memory_tracker/stores/gcstat_logfile_store.rb', line 21

def stats
end