logstash-output-qingstor 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/outputs/qingstor.rb +14 -6
- data/logstash-output-qingstor.gemspec +1 -1
- data/spec/outputs/qingstor_spec.rb +5 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46170bdbbd13271afd875490c56b4d77dc2bed5dac63a63030b69dff5895f78d
|
4
|
+
data.tar.gz: 8b7d9bd379b57980e61fd2b20475bc12181d7154c701de0d4f5af224e2defc47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 171d450378ab1852dddb0815e01d9d4f0c964a8fd81c5974cb17bfbd152fbe9fe7ebcb439c9491f598c7cfa9eb4e2ff329cd5404932e7ae3320ca070775635e1
|
7
|
+
data.tar.gz: b8a50149df4fd8e6e3b526eb99188559a4cca0c3f1c96a65bbb1578b2b4c3d5f11d2c108edee81f82e557f4d98c385fa7d74109eb105e018bc983ab79195ea40
|
data/CHANGELOG.md
CHANGED
@@ -256,13 +256,21 @@ class LogStash::Outputs::Qingstor < LogStash::Outputs::Base
|
|
256
256
|
.each do |file|
|
257
257
|
temp_file = TemporaryFile.create_from_existing_file(file,
|
258
258
|
temp_folder_path)
|
259
|
-
|
259
|
+
|
260
|
+
# Restoring too large file would cause java heap out of memory
|
261
|
+
if temp_file.size > 0 && temp_file.size < 100 * 1024 * 1024
|
262
|
+
@logger.debug('Recoving from crash and uploading',
|
263
|
+
:file => temp_file.path)
|
264
|
+
@crash_uploader.upload_async(
|
265
|
+
temp_file,
|
266
|
+
:on_complete => method(:clean_temporary_file),
|
267
|
+
:upload_options => upload_options
|
268
|
+
)
|
269
|
+
elsif temp_file.size == 0
|
270
|
+
@logger.debug('Recoving from crash, delete empty files',
|
260
271
|
:file => temp_file.path)
|
261
|
-
|
262
|
-
|
263
|
-
:on_complete => method(:clean_temporary_file),
|
264
|
-
:upload_options => upload_options
|
265
|
-
)
|
272
|
+
temp_file.delete!
|
273
|
+
end
|
266
274
|
end
|
267
275
|
end
|
268
276
|
end # class LogStash::Outputs::Qingstor
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-qingstor'
|
3
|
-
s.version = '0.2.
|
3
|
+
s.version = '0.2.7'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = 'logstash output plugin for qingstor'
|
6
6
|
s.description = 'Collect the outputs of logstash and store into QingStor'
|
@@ -44,12 +44,11 @@ describe LogStash::Outputs::Qingstor do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'upload existing file if turn on restore function' do
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
f.close
|
47
|
+
non_empty_file = File.open(File.join(tmpdir, 'non-empty-file'), 'w')
|
48
|
+
non_empty_file.write(event_encoded * 10)
|
49
|
+
non_empty_file.close
|
50
|
+
empty_file = File.open(File.join(tmpdir, 'empty-file'), 'w')
|
51
|
+
empty_file.close
|
53
52
|
fetch_event(options.merge('restore' => true, 'tmpdir' => tmpdir),
|
54
53
|
events_and_encoded)
|
55
54
|
expect(list_remote_file.size).to eq(2)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-qingstor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Zhao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|