class LogStash::Outputs::Qingstor::RotationPolicy::Time

Public Class Methods

new(_, file_time) click to toggle source
# File lib/logstash/outputs/qingstor/rotation_policy.rb, line 27
def initialize(_, file_time)
  @file_time = file_time
  positive_check(@file_time)
end

Public Instance Methods

rotate?(file) click to toggle source
# File lib/logstash/outputs/qingstor/rotation_policy.rb, line 32
def rotate?(file)
  !file.empty? && (::Time.now - file.ctime) >= @file_time
end
to_s() click to toggle source
# File lib/logstash/outputs/qingstor/rotation_policy.rb, line 36
def to_s
  { :policy => name, :file_time => @file_time }.to_s
end