logworm_amqp 0.8.8 → 0.8.9

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.8.9
2
+ Cleaned up pushed stats output.
3
+
1
4
  v0.8.8
2
5
  Now retrieve amqp_url remotely for better security.
3
6
 
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'echoe'
2
- Echoe.new('logworm_amqp', '0.8.8') do |p|
2
+ Echoe.new('logworm_amqp', '0.8.9') do |p|
3
3
  p.description = "logworm logging tool"
4
4
  p.url = "http://www.logworm.com"
5
5
  p.author = "Pomelo, LLC"
data/lib/base/db.rb CHANGED
@@ -115,10 +115,11 @@ module Logworm
115
115
  resp = db_call(:get, "#{host_with_protocol}/amqp_url")
116
116
  @amqp_url = resp["url"]
117
117
  @stats_freq = resp["stats_freq"]
118
- puts "Found: #{@amqp_url}, #{@stats_freq}"
118
+ $stderr.puts "logworm server acquired: #{@amqp_url}"
119
119
  Minion.amqp_url = @amqp_url
120
120
  rescue
121
121
  @last_attempt = Time.now
122
+ $stderr.puts "logworm cannot connect to server; please wait at least #{RETRY_FREQUENCY} seconds. log entries will be lost"
122
123
  end
123
124
  end
124
125
  !(@amqp_url.nil?)
@@ -129,7 +130,7 @@ module Logworm
129
130
  content = payload.to_json
130
131
  sig= signature(content, @token_secret )
131
132
  Minion.enqueue(queue, {:payload => content, :consumer_key => @token, :signature => sig,
132
- :env => ENV['RACK_ENV'] || "?", :timestamp => Time.now})
133
+ :env => ENV['RACK_ENV'] || "?"})
133
134
  end
134
135
  end
135
136
 
@@ -148,13 +149,16 @@ module Logworm
148
149
  end
149
150
 
150
151
  def push_stats()
151
- to_amqp("lw.stats", {:avg => (@total_time / @tock), :max => @amqp_max, :min => @amqp_min, :total => @total_time, :count => @tock})
152
+ to_amqp("lw.stats", {:avg => (@total_time / @tock), :max => @amqp_max, :min => @amqp_min,
153
+ :total => @total_time, :count => @tock, :sampling_length => (Time.now - @sampling_start) })
154
+ $stderr.puts "logworm statistics: #{@tock} messages sent in #{Time.now - @sampling_start}. Times: #{(@total_time / @tock) * 1000}/#{@amqp_min * 1000}/#{@amqp_max * 1000} (avg/min/max seconds)"
152
155
  reset_stats
153
156
  end
154
157
 
155
158
  def reset_stats()
156
159
  @total_time = @tock = @amqp_max = 0
157
160
  @amqp_min = MIN_AQMP
161
+ @sampling_start = Time.now
158
162
  end
159
163
 
160
164
  def batch_log(entries)
data/logworm_amqp.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{logworm_amqp}
5
- s.version = "0.8.8"
5
+ s.version = "0.8.9"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Pomelo, LLC"]
9
- s.date = %q{2010-08-06}
9
+ s.date = %q{2010-08-08}
10
10
  s.description = %q{logworm logging tool}
11
11
  s.email = %q{schapira@pomelollc.com}
12
12
  s.extra_rdoc_files = ["CHANGELOG", "README.md", "lib/base/config.rb", "lib/base/db.rb", "lib/base/query_builder.rb", "lib/logworm_amqp.rb"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logworm_amqp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 8
10
- version: 0.8.8
9
+ - 9
10
+ version: 0.8.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pomelo, LLC
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-06 00:00:00 -04:00
18
+ date: 2010-08-08 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency