Sha256: 33c2a635e2e2c72608b0b7f5c9df7ee2330df319f11339fb042d9aec2024d308

Contents?: true

Size: 389 Bytes

Versions: 115

Compression:

Stored size: 389 Bytes

Contents

require 'open3'

module Prometheus
  module Client
    module PageSize
      def self.page_size(fallback_page_size: 4096)
        stdout, status = Open3.capture2('getconf PAGESIZE')
        return fallback_page_size if status.nil? || !status.success?

        page_size = stdout.chomp.to_i
        return fallback_page_size if page_size <= 0

        page_size
      end
    end
  end
end

Version data entries

115 entries across 115 versions & 2 rubygems

Version Path
vinted-prometheus-client-mmap-1.7.0 lib/prometheus/client/page_size.rb
vinted-prometheus-client-mmap-1.7.0-x86_64-linux lib/prometheus/client/page_size.rb
vinted-prometheus-client-mmap-1.6.0 lib/prometheus/client/page_size.rb
vinted-prometheus-client-mmap-1.6.0-x86_64-linux lib/prometheus/client/page_size.rb
vinted-prometheus-client-mmap-1.5.0-x86_64-linux lib/prometheus/client/page_size.rb
vinted-prometheus-client-mmap-1.4.0 lib/prometheus/client/page_size.rb
vinted-prometheus-client-mmap-1.3.0 lib/prometheus/client/page_size.rb
vinted-prometheus-client-mmap-1.2.2 lib/prometheus/client/page_size.rb
vinted-prometheus-client-mmap-1.2.1 lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.1.1 lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.1.1-x86_64-linux lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.1.1-x86_64-darwin lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.1.1-arm64-darwin lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.1.1-aarch64-linux lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.1.0 lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.1.0-x86_64-linux lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.1.0-x86_64-darwin lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.1.0-arm64-darwin lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.1.0-aarch64-linux lib/prometheus/client/page_size.rb
prometheus-client-mmap-1.0.3 lib/prometheus/client/page_size.rb