Class: LogStash::Outputs::OSS::SizeBasedRotation
- Inherits:
-
Object
- Object
- LogStash::Outputs::OSS::SizeBasedRotation
- Defined in:
- lib/logstash/outputs/oss/rotations/size_based_rotation.rb
Instance Attribute Summary collapse
-
#size_rotate ⇒ Object
readonly
Returns the value of attribute size_rotate.
Instance Method Summary collapse
-
#initialize(size_rotate) ⇒ SizeBasedRotation
constructor
A new instance of SizeBasedRotation.
- #needs_periodic_check? ⇒ Boolean
- #rotate?(file) ⇒ Boolean
Constructor Details
#initialize(size_rotate) ⇒ SizeBasedRotation
Returns a new instance of SizeBasedRotation.
8 9 10 11 12 13 |
# File 'lib/logstash/outputs/oss/rotations/size_based_rotation.rb', line 8 def initialize(size_rotate) if size_rotate <= 0 raise LogStash::ConfigurationError, "Logstash OSS output has wrong configuration: size_rotate must be positive if strategy is `size`" end @size_rotate = size_rotate end |
Instance Attribute Details
#size_rotate ⇒ Object (readonly)
Returns the value of attribute size_rotate.
6 7 8 |
# File 'lib/logstash/outputs/oss/rotations/size_based_rotation.rb', line 6 def size_rotate @size_rotate end |
Instance Method Details
#needs_periodic_check? ⇒ Boolean
19 20 21 |
# File 'lib/logstash/outputs/oss/rotations/size_based_rotation.rb', line 19 def needs_periodic_check? false end |
#rotate?(file) ⇒ Boolean
15 16 17 |
# File 'lib/logstash/outputs/oss/rotations/size_based_rotation.rb', line 15 def rotate?(file) file.size >= @size_rotate end |