logstash-output-qingstor 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +0,0 @@
1
- # encoding: utf-8
2
- module LogStash
3
- module Outputs
4
- class Qingstor
5
- class TimeRotationPolicy
6
- attr_reader :time_file
7
-
8
- def initialize(time_file)
9
- if time_file <= 0
10
- raise LogStash::ConfigurationError, "'time_file' need to be greater then 0"
11
- end
12
-
13
- @time_file = time_file * 60
14
- end
15
-
16
- def rotate?(file)
17
- file.size > 0 && (Time.now - file.ctime) >= time_file
18
- end
19
-
20
- def needs_periodic?
21
- true
22
- end
23
- end
24
- end
25
- end
26
- end