class Prometheus::Client::Helper::PlainFile
Parses DB files without using mmap
Attributes
filepath[R]
Public Class Methods
new(filepath)
click to toggle source
# File lib/prometheus/client/helper/plain_file.rb, line 15 def initialize(filepath) @filepath = filepath end
Public Instance Methods
size()
click to toggle source
# File lib/prometheus/client/helper/plain_file.rb, line 23 def size source.length end
slice(*args)
click to toggle source
# File lib/prometheus/client/helper/plain_file.rb, line 19 def slice(*args) source.slice(*args) end
source()
click to toggle source
# File lib/prometheus/client/helper/plain_file.rb, line 11 def source @data ||= File.read(filepath, mode: 'rb') end