lib/prometheus/client/helper/mmaped_file.rb in prometheus-client-mmap-0.7.0.beta34 vs lib/prometheus/client/helper/mmaped_file.rb in prometheus-client-mmap-0.7.0.beta35
- old
+ new
@@ -5,12 +5,13 @@
module Prometheus
module Client
module Helper
class MmapedFile < Mmap
- include FastMmapedFile
include EntryParser
+ include FastMmapedFile
+
attr_reader :filepath, :size
def initialize(filepath, mode = 'r', protection = Mmap::MAP_SHARED, options = {})
@filepath = filepath
@@ -18,13 +19,9 @@
file.truncate(initial_mmap_file_size) if file.size < MINIMUM_SIZE
@size = file.size
end
super(filepath, mode, protection, options)
- end
-
- def used=(value)
- self[0..3] = [value].pack('l')
end
def close
munmap
end