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