alblogs 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d2aea6572a238675e0499c04e26341ea3cd3b8860b94c51095fe9c00cb4d806
4
- data.tar.gz: 45a86b3b527c47bee978d0139c473c3aa491a1bddea41d2d10135093cc0cde4c
3
+ metadata.gz: 76c233cf10e2558be79ef68d0f92670181be1b7bd1b24eb7c5376a21264856bc
4
+ data.tar.gz: f4bf7a47915a7a8763e9826f694e19a3c270440b047a93e73327a19c47a59684
5
5
  SHA512:
6
- metadata.gz: 141b1919b75fc436dcb627fb93c20fd1312e57aa4d2b1525d1c7180f8e4921dba8c5af93614392f93162f9006756d4eba04a896f1ec18511033d4db7bdc7ae40
7
- data.tar.gz: cc2c69a05b388d603c7e40cdf29759f57090b6894a4f9a001d1157a57a03692b419963e1f086efa6a87a35175ba4797b1a3121ea779c71a6f48bb92a46798f84
6
+ metadata.gz: 0de9e99529e3f13eddccf1f450bc11ee96a8e1b9c0827833343bd376f52e47d6de13aab8979bbc05273ddad67bfb3303235d3973c7ccdf50bb8388a2bfc76b34
7
+ data.tar.gz: 8cf0c70772dd797c748b606243585704af31d15964be8eae00856bb470d4e5f4ff844b4b4566ffa9ce68f83b495cef4e89230a0a49343949b81e1d93017d01f8
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'alblogs'
5
- s.version = '0.1.2'
5
+ s.version = '0.1.4'
6
6
  s.summary = 'ALB access log processing'
7
7
  s.description = 'Utility script for processing ALB access logs over a given time range'
8
8
  s.authors = ['Doug Youch']
@@ -17,5 +17,11 @@ module Alblogs
17
17
  def self.get_fields(line)
18
18
  REGEXP.match(line).to_a
19
19
  end
20
+
21
+ def self.each_entry(io)
22
+ while !io.eof?
23
+ yield from_line(io.readline)
24
+ end
25
+ end
20
26
  end
21
27
  end
@@ -31,10 +31,10 @@ module Alblogs
31
31
 
32
32
  stats[:total_file_processing_time] += measure do
33
33
  File.open(tmp_file, 'rb') do |f|
34
- while(! f.eof? && ! @stop)
35
- stats[:lines] += 1
36
- line = f.readline
37
- entry = ::Alblogs::Entry.from_line(line)
34
+ ::Alblogs::Entry.each_entry(f) do |entry|
35
+ break if @stop
36
+
37
+ stats[:entries] += 1
38
38
  stats[:min_log_time] = ! stats[:min_log_time] || stats[:min_log_time] > entry.timestamp ? entry.timestamp : stats[:min_log_time]
39
39
  stats[:max_log_time] = ! stats[:max_log_time] || stats[:max_log_time] < entry.timestamp ? entry.timestamp : stats[:max_log_time]
40
40
  next if request_matcher && !request_matcher.match?(entry)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alblogs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch