logworm_amqp 0.8.8 → 0.8.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/Rakefile +1 -1
- data/lib/base/db.rb +7 -3
- data/logworm_amqp.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
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 "
|
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
|
-
|
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,
|
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.
|
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-
|
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:
|
4
|
+
hash: 45
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.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-
|
18
|
+
date: 2010-08-08 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|