logworm_client 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.4.1
2
+ Show in console time spent communicating with the server.
3
+
1
4
  v0.4.0 Added support for running on Rails!
2
5
  To use, add config.gem ‘logworm_client’ to environment.rb
3
6
  Then you can configure in ApplicationController, via logs_requests [:short | :long]+
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'echoe'
2
- Echoe.new('logworm_client', '0.4.0') do |p|
2
+ Echoe.new('logworm_client', '0.4.1') do |p|
3
3
  p.description = "logworm client utilities"
4
4
  p.url = "http://www.logworm.com"
5
5
  p.author = "Pomelo, LLC"
@@ -1,3 +1,5 @@
1
+ require 'benchmark'
2
+
1
3
  module Logworm
2
4
  class Rack
3
5
 
@@ -23,7 +25,8 @@ module Logworm
23
25
  :profiling => appTime}) if @log_requests_short
24
26
  begin
25
27
  Timeout::timeout(1) {
26
- Logger.flush # Flushes only if there are any entries. Times out after half second
28
+ ts = Benchmark.realtime {Logger.flush} # Flushes only if there are any entries. Times out after a second
29
+ env['rack.errors'].puts("\t *** logworm - logs sent in #{ts} seconds")
27
30
  }
28
31
  rescue Exception => e
29
32
  # Ignore --nothing we can do
@@ -12,6 +12,8 @@
12
12
  ###
13
13
  if defined?(ActionController)
14
14
 
15
+ require 'benchmark'
16
+
15
17
  ActionController::Base.class_eval do
16
18
  @@log_requests_short = true
17
19
  @@log_requests_long = false
@@ -45,7 +47,8 @@ if defined?(ActionController)
45
47
  :profiling => appTime}) if @@log_requests_short
46
48
  begin
47
49
  Timeout::timeout(1) {
48
- Logworm::Logger.flush # Flushes only if there are any entries. Times out after a second
50
+ ts = Benchmark.realtime {Logworm::Logger.flush} # Flushes only if there are any entries. Times out after a second
51
+ logger.info("\t *** logworm - logs sent in #{ts} seconds")
49
52
  }
50
53
  rescue Exception => e
51
54
  # Ignore --nothing we can do
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{logworm_client}
5
- s.version = "0.4.0"
5
+ s.version = "0.4.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-03-04}
9
+ s.date = %q{2010-03-13}
10
10
  s.description = %q{logworm client utilities}
11
11
  s.email = %q{schapira@pomelollc.com}
12
12
  s.executables = ["lw-compute", "lw-heroku", "lw-tail"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 0
9
- version: 0.4.0
8
+ - 1
9
+ version: 0.4.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-03-04 00:00:00 -05:00
17
+ date: 2010-03-13 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency