Sha256: 2ce557d68ef13b1564e2613ca0fe882584b2bb31f2c13bd36a5a8051339faa6b
Contents?: true
Size: 673 Bytes
Versions: 9
Compression:
Stored size: 673 Bytes
Contents
# frozen_string_literal: true module RailsServerMonitor module Warnings class LowMemoryComponent < ViewComponent::Base attr_reader :ctx def initialize(ctx:) @ctx = ctx end def scope @scope ||= RailsServerMonitor::ServerSnapshot .includes(:rails_server_monitor_server) .where("ram_usage_percentage >= ?", max_memory_usage) .where("created_at > ?", 3.days.ago) .limit(100) end def config RailsServerMonitor.config end def max_memory_usage 100 - config.low_memory_threshold end end end end
Version data entries
9 entries across 9 versions & 1 rubygems