simple_apm 1.0.6 → 1.0.7

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: c6c7724ac3789dbc51e7e8204bda7db3f3bd6ab8b4902a6533a36e75c39f26bd
4
- data.tar.gz: 70956572137d0930ad2e3e57f365bab309d33c208a85bd596c8a4669968e804c
3
+ metadata.gz: e8c989664fa3b8d390ac868ac144adf3f8c75114374d4843cb80c6ec36080eed
4
+ data.tar.gz: fdc007de42402503a588d7775d2a410527c125c012ff5b5c56b9d3581c1379f9
5
5
  SHA512:
6
- metadata.gz: 8fad79fd506a39a77f468fd48ab5da873466d340a04082bb33f124aaa3d2a300b853ff9b64db0f35ea4c3ee4a792a18923039fabfa04271e7eeedc43a55449ce
7
- data.tar.gz: 1f71a63f8c3984a8f59f26261bbda98c5665bb8074d43eaa004be8e1ee9d827fb9ef934fd176db6c3a8de0d1edadec382bf9c3d6dce654de7caf00a40b521ce7
6
+ metadata.gz: d0327ea89887bdc55829cbb976726b991ef836e349eedea1ee98c517d1e2e24bb86cb82950ddbfdade6c9718fb3826bbe4c2fe4261fd6158a56fb44d5acd7a49
7
+ data.tar.gz: c45971ff9bf1fd1683ab5110988cf0f37e52431ae202891ab2d4345f7497ed312e01bc7074cee1b953e745deaf34cdac79383c9155e3e5713c7774545cd0b136
@@ -0,0 +1,8 @@
1
+ class ErrorLogger
2
+ class << self
3
+ def log(e)
4
+ @logger ||= Logger.new("#{Rails.root}/log/simple_apm_error.log")
5
+ @logger.error(e)
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module SimpleApm
2
- VERSION = '1.0.6'
2
+ VERSION = '1.0.7'
3
3
  end
@@ -31,6 +31,7 @@ module SimpleApm
31
31
  if request_id.present?
32
32
  if need_skip
33
33
  SimpleApm::Sql.delete_by_request_id(request_id)
34
+ SimpleApm::HttpRequest.delete_by_request_id(request_id)
34
35
  else
35
36
  action_name = "#{payload[:controller]}##{payload[:action]}"
36
37
  memory_during = completed_memory - started_memory rescue 0
@@ -62,11 +63,12 @@ module SimpleApm
62
63
  SimpleApm::Request.create info
63
64
  else
64
65
  SimpleApm::Sql.delete_by_request_id(request_id)
66
+ SimpleApm::HttpRequest.delete_by_request_id(request_id)
65
67
  end
66
68
  end
67
69
  end
68
70
  rescue => e
69
- Logger.new("#{Rails.root}/log/simple_apm.log").info e.backtrace.join("\n")
71
+ ErrorLogger.log e.backtrace.join("\n")
70
72
  end
71
73
  end
72
74
 
@@ -93,7 +95,7 @@ module SimpleApm
93
95
  SimpleApm::Sql.create request_id, info
94
96
  end
95
97
  rescue => e
96
- Logger.new("#{Rails.root}/log/simple_apm.log").info e.backtrace.join("\n")
98
+ ErrorLogger.log e.backtrace.join("\n")
97
99
  end
98
100
  end
99
101
 
@@ -119,7 +121,7 @@ module SimpleApm
119
121
  SimpleApm::HttpRequest.create request_id, info
120
122
  end
121
123
  rescue => e
122
- Logger.new("#{Rails.root}/log/simple_apm.log").info e.backtrace.join("\n")
124
+ ErrorLogger.log e.backtrace.join("\n")
123
125
  end
124
126
  end
125
127
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - yuanyin.xia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-15 00:00:00.000000000 Z
11
+ date: 2018-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -103,6 +103,7 @@ files:
103
103
  - lib/generators/simple_apm/install_generator.rb
104
104
  - lib/simple_apm.rb
105
105
  - lib/simple_apm/engine.rb
106
+ - lib/simple_apm/error_logger.rb
106
107
  - lib/simple_apm/net_http.rb
107
108
  - lib/simple_apm/redis.rb
108
109
  - lib/simple_apm/setting.rb