aws-logs 0.3.2 → 0.3.3
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/aws_logs/tail.rb +8 -1
- data/lib/aws_logs/version.rb +1 -1
- 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: e2d97ba7271f44e4d07374bf86cb6925ada130f8359f4efa1c56ecb7903d7d0c
|
4
|
+
data.tar.gz: 8faef88a6dbf7c0a0ed7f9d10d2a7975fd942fb89a5fc88ea43a29cac645c0ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebcf238f59349ec1ba0abc6e4f285db9b23062f9d1d35085af59d16b976bd0ba84a0bf37740fd8726cc33fe9f8607cc286faefbd5b3d55a5134dcd30ea796f83
|
7
|
+
data.tar.gz: 27a69941be1c6b4ec8b62850eafb7764f47b3995bdabff1dd780120f9d8091c060567d2d8834b409efd71042a3fa4fa4e5b3b2fefa207c506f074e070b0cdba2
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.3.3]
|
7
|
+
- #2 add overlap to window to account for delayed logs received at the same time
|
8
|
+
|
6
9
|
## [0.3.2]
|
7
10
|
- #1 clean up end_loop_signal logic
|
8
11
|
|
data/lib/aws_logs/tail.rb
CHANGED
@@ -35,11 +35,15 @@ module AwsLogs
|
|
35
35
|
return
|
36
36
|
end
|
37
37
|
|
38
|
+
# We overlap the sliding window because CloudWatch logs can receive or send the logs out of order.
|
39
|
+
# For example, a bunch of logs can all come in at the same second, but they haven't registered to CloudWatch logs
|
40
|
+
# yet. If we don't overlap the sliding window then we'll miss the logs that were delayed in registering.
|
41
|
+
overlap = 60*1000 # overlap the sliding window by a minute
|
38
42
|
since, now = initial_since, current_now
|
39
43
|
until end_loop?
|
40
44
|
refresh_events(since, now)
|
41
45
|
display
|
42
|
-
since, now = now, current_now
|
46
|
+
since, now = now-overlap, current_now
|
43
47
|
loop_count!
|
44
48
|
sleep 5 if @follow && !ENV["AWS_LOGS_TEST"]
|
45
49
|
end
|
@@ -118,6 +122,9 @@ module AwsLogs
|
|
118
122
|
}
|
119
123
|
end
|
120
124
|
|
125
|
+
# The stop_follow! results in a little waiting because it signals to break the polling loop.
|
126
|
+
# Since it's in the middle of the loop process, the loop will finish the sleep 5 first.
|
127
|
+
# So it can pause from 0-5 seconds.
|
121
128
|
@@end_loop_signal = false
|
122
129
|
def self.stop_follow!
|
123
130
|
@@end_loop_signal = true
|
data/lib/aws_logs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-logs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|