logworm_client 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/Rakefile +3 -3
- data/bin/lw-compute +4 -0
- data/bin/lw-tail +9 -6
- data/lib/logworm_utils/compute.rb +1 -1
- data/lib/logworm_utils/tail.rb +3 -3
- data/logworm_client.gemspec +8 -8
- data/spec/rails_spec.rb +0 -5
- metadata +7 -7
data/CHANGELOG
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
v0.7.1
|
2
|
+
lw-tail and lw-compute now receive an optional app parameter, for the cases where you want to call command-line tools from a directory other than the app's directory... or when you have more than one Heroku remote/app from the same directory
|
3
|
+
|
1
4
|
v0.7.0
|
2
5
|
Eliminated long logs. Instead, there's now a parameter (log_request_headers in Rack, lw_log_request_headers in Rails) to add
|
3
6
|
request and response headers to the web_log.
|
data/Rakefile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'echoe'
|
2
|
-
Echoe.new('logworm_client', '0.7.
|
2
|
+
Echoe.new('logworm_client', '0.7.1') do |p|
|
3
3
|
p.description = "logworm client utilities"
|
4
4
|
p.url = "http://www.logworm.com"
|
5
5
|
p.author = "Pomelo, LLC"
|
6
6
|
p.email = "schapira@pomelollc.com"
|
7
7
|
p.ignore_pattern = ["tmp/*", "script/*"]
|
8
|
-
p.development_dependencies = ["logworm >=0.7.
|
9
|
-
p.runtime_dependencies = ["logworm >=0.7.
|
8
|
+
p.development_dependencies = ["logworm >=0.7.7", "json"]
|
9
|
+
p.runtime_dependencies = ["logworm >=0.7.7", "json"]
|
10
10
|
end
|
data/bin/lw-compute
CHANGED
@@ -15,6 +15,10 @@ options = {
|
|
15
15
|
option_parser = OptionParser.new do |opts|
|
16
16
|
opts.banner = "Usage: #{$0} [options] <log table> <function> <field>"
|
17
17
|
|
18
|
+
opts.on("--app app", String, "Specify the Heroku app") do |app|
|
19
|
+
options[:app] = app.strip
|
20
|
+
end
|
21
|
+
|
18
22
|
opts.on("-g group", String, "Specify an aggregation group (e.g, hour(_ts_utc), or response.code)") do |k|
|
19
23
|
options[:aggregate_group] = k
|
20
24
|
end
|
data/bin/lw-tail
CHANGED
@@ -4,10 +4,10 @@ require 'rubygems'
|
|
4
4
|
require 'logworm_utils'
|
5
5
|
require 'optparse'
|
6
6
|
|
7
|
-
def help(option_parser)
|
7
|
+
def help(option_parser, options)
|
8
8
|
puts option_parser.help
|
9
9
|
puts
|
10
|
-
LogwormTail.list
|
10
|
+
LogwormTail.list(options)
|
11
11
|
end
|
12
12
|
|
13
13
|
options = {
|
@@ -25,6 +25,10 @@ options = {
|
|
25
25
|
option_parser = OptionParser.new do |opts|
|
26
26
|
opts.banner = "Usage: #{$0} [options] <log table>"
|
27
27
|
|
28
|
+
opts.on("--app app", String, "Specify the Heroku app") do |app|
|
29
|
+
options[:app] = app.strip
|
30
|
+
end
|
31
|
+
|
28
32
|
opts.on("-f [secs]", Integer,
|
29
33
|
"Continuously check for more data, every [secs] seconds.", "Default: #{options[:frequency]}") do |s|
|
30
34
|
options[:loop] = true
|
@@ -60,8 +64,7 @@ option_parser = OptionParser.new do |opts|
|
|
60
64
|
end
|
61
65
|
|
62
66
|
opts.on( '-h', '--help', 'Display this screen' ) do
|
63
|
-
help
|
64
|
-
exit(1)
|
67
|
+
options[:help] = true
|
65
68
|
end
|
66
69
|
|
67
70
|
end
|
@@ -69,8 +72,8 @@ end
|
|
69
72
|
# Parse, and get the required <table>
|
70
73
|
option_parser.parse!
|
71
74
|
table = ARGV.pop
|
72
|
-
if !table
|
73
|
-
help option_parser
|
75
|
+
if !table or options[:help]
|
76
|
+
help option_parser, options
|
74
77
|
exit(1)
|
75
78
|
end
|
76
79
|
table.strip!
|
@@ -8,7 +8,7 @@ class LogwormCompute
|
|
8
8
|
@valuefield = @field ? "#{@function}(#{@field})" : @function
|
9
9
|
|
10
10
|
begin
|
11
|
-
@db = Logworm::DB.from_config_or_die
|
11
|
+
@db = Logworm::DB.from_config_or_die(@options[:app])
|
12
12
|
spec = {:aggregate_function => @function, :aggregate_argument => @field}.merge(@options)
|
13
13
|
@query = Logworm::QueryBuilder.new(spec)
|
14
14
|
rescue Exception => e
|
data/lib/logworm_utils/tail.rb
CHANGED
@@ -4,7 +4,7 @@ class LogwormTail
|
|
4
4
|
@options = options
|
5
5
|
|
6
6
|
begin
|
7
|
-
@db = Logworm::DB.from_config_or_die
|
7
|
+
@db = Logworm::DB.from_config_or_die(@options[:app])
|
8
8
|
@query = Logworm::QueryBuilder.new(@options.merge(:force_ts => true))
|
9
9
|
rescue Exception => e
|
10
10
|
$stderr.puts "Error: #{e}"
|
@@ -12,9 +12,9 @@ class LogwormTail
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.list
|
15
|
+
def self.list(options = {})
|
16
16
|
begin
|
17
|
-
@db = Logworm::DB.from_config_or_die
|
17
|
+
@db = Logworm::DB.from_config_or_die(options[:app])
|
18
18
|
@tables = @db.tables
|
19
19
|
if @tables and @tables.size > 0
|
20
20
|
puts "The following are the tables that you've created thus far:"
|
data/logworm_client.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{logworm_client}
|
5
|
-
s.version = "0.7.
|
5
|
+
s.version = "0.7.1"
|
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-06-
|
9
|
+
s.date = %q{2010-06-24}
|
10
10
|
s.description = %q{logworm client utilities}
|
11
11
|
s.email = %q{schapira@pomelollc.com}
|
12
12
|
s.executables = ["lw-compute", "lw-tail"]
|
@@ -24,20 +24,20 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.specification_version = 3
|
25
25
|
|
26
26
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
|
-
s.add_runtime_dependency(%q<logworm>, [">= 0.7.
|
27
|
+
s.add_runtime_dependency(%q<logworm>, [">= 0.7.7"])
|
28
28
|
s.add_runtime_dependency(%q<json>, [">= 0"])
|
29
|
-
s.add_development_dependency(%q<logworm>, [">= 0.7.
|
29
|
+
s.add_development_dependency(%q<logworm>, [">= 0.7.7"])
|
30
30
|
s.add_development_dependency(%q<json>, [">= 0"])
|
31
31
|
else
|
32
|
-
s.add_dependency(%q<logworm>, [">= 0.7.
|
32
|
+
s.add_dependency(%q<logworm>, [">= 0.7.7"])
|
33
33
|
s.add_dependency(%q<json>, [">= 0"])
|
34
|
-
s.add_dependency(%q<logworm>, [">= 0.7.
|
34
|
+
s.add_dependency(%q<logworm>, [">= 0.7.7"])
|
35
35
|
s.add_dependency(%q<json>, [">= 0"])
|
36
36
|
end
|
37
37
|
else
|
38
|
-
s.add_dependency(%q<logworm>, [">= 0.7.
|
38
|
+
s.add_dependency(%q<logworm>, [">= 0.7.7"])
|
39
39
|
s.add_dependency(%q<json>, [">= 0"])
|
40
|
-
s.add_dependency(%q<logworm>, [">= 0.7.
|
40
|
+
s.add_dependency(%q<logworm>, [">= 0.7.7"])
|
41
41
|
s.add_dependency(%q<json>, [">= 0"])
|
42
42
|
end
|
43
43
|
end
|
data/spec/rails_spec.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 7
|
8
|
-
-
|
9
|
-
version: 0.7.
|
8
|
+
- 1
|
9
|
+
version: 0.7.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Pomelo, LLC
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-06-
|
17
|
+
date: 2010-06-24 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -27,8 +27,8 @@ dependencies:
|
|
27
27
|
segments:
|
28
28
|
- 0
|
29
29
|
- 7
|
30
|
-
-
|
31
|
-
version: 0.7.
|
30
|
+
- 7
|
31
|
+
version: 0.7.7
|
32
32
|
type: :runtime
|
33
33
|
version_requirements: *id001
|
34
34
|
- !ruby/object:Gem::Dependency
|
@@ -53,8 +53,8 @@ dependencies:
|
|
53
53
|
segments:
|
54
54
|
- 0
|
55
55
|
- 7
|
56
|
-
-
|
57
|
-
version: 0.7.
|
56
|
+
- 7
|
57
|
+
version: 0.7.7
|
58
58
|
type: :development
|
59
59
|
version_requirements: *id003
|
60
60
|
- !ruby/object:Gem::Dependency
|