health_check/app/models/health_check_log.rb

16 lines
455 B
Ruby

# encoding: utf-8
class HealthCheckLog
include Mongoid::Document
include Mongoid::Timestamps
field :url, type: String
field :status, type: Integer
field :response_time, type: Float
field :error_message, type: String
belongs_to :health_check_monitor, class_name: "HealthCheckMonitor", optional: true
index({ health_check_monitor_id: 1, created_at: -1 })
index({ created_at: 1 }, { expire_after_seconds: 2592000 })
end