aws-logs 0.3.2 → 0.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc241de69ed1390414efd6a39d3d97d341bbdcfbca2119cf98045c5abb268f35
4
- data.tar.gz: 5f2ffe9ec6f6bea4a9626471c7b6acc58768e88b53adcf7ef3b3dcf28fb4b37b
3
+ metadata.gz: e2d97ba7271f44e4d07374bf86cb6925ada130f8359f4efa1c56ecb7903d7d0c
4
+ data.tar.gz: 8faef88a6dbf7c0a0ed7f9d10d2a7975fd942fb89a5fc88ea43a29cac645c0ee
5
5
  SHA512:
6
- metadata.gz: 3829280d3ea9e1f37f3c5cfabd1914cdecc9831989ca306699c1cb4cbcc9e5950a684661dea0bac3a674565766cd39c435cdc9a7e72c22bc096357ae11e99f0d
7
- data.tar.gz: 5503713da8c2b5123254b5cce349684dfe8448a43fc94e90d372bde7a6ccd8791a33cb19f5f1187966421c3255560ee74547df6db51e9814ec819f23d3cf47e3
6
+ metadata.gz: ebcf238f59349ec1ba0abc6e4f285db9b23062f9d1d35085af59d16b976bd0ba84a0bf37740fd8726cc33fe9f8607cc286faefbd5b3d55a5134dcd30ea796f83
7
+ data.tar.gz: 27a69941be1c6b4ec8b62850eafb7764f47b3995bdabff1dd780120f9d8091c060567d2d8834b409efd71042a3fa4fa4e5b3b2fefa207c506f074e070b0cdba2
@@ -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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module AwsLogs
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
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.2
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-28 00:00:00.000000000 Z
11
+ date: 2019-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport