simple_apm 1.0.9 → 1.0.10

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: 5c91db688c65ce6f3494af08efe52113e34f6b717b70ad1bbd7f7940d7439734
4
- data.tar.gz: 5d4d4b1d8ed80f91f07a8e11a41e884aaf7ac057c592a3d9adb214844ab7bf41
3
+ metadata.gz: 13c4a3af0428d79e6e98ad4e523ccdbc6e62f756aedbecb6289f55c9613c07bc
4
+ data.tar.gz: a44fe2e03f9080a7c44354b9923598f3c83028cf3d432363dd8c3feaec157b3e
5
5
  SHA512:
6
- metadata.gz: 451a075c9e513bd609d990a8907b985fa9afec5449327cb4542eddde3de91c2446649e0edbced46347ae85b6c164d7e1258234d0477c8a6f5356f502a8f28ede
7
- data.tar.gz: 68e68a6dc70ee52c31141de9023f58f25187a47699589f92789c47235f4344d4b37b644fe88184a2a821695efca16ac558b68a5a9474e02ce1eaffbcdf701a08
6
+ metadata.gz: d1d2bad5ed7af59fdab080e4ee6345a28f5454c3eab359383ccb343d2d80fe778d3bab84cc06682b68592a765625e8edd91bac365ec341c75c20df57da3a739f
7
+ data.tar.gz: fcb8e12ddcc73ba608d8e8ffbfab7303b817fec99aa753846d21dfd7a8abd9475c0c1c8eaeb28d825fa817864df82859f4f504f07e86816e7b1cc1cb83639b56
@@ -1,15 +1,21 @@
1
- <table id="slow-requests" class="table">
1
+ <style>
2
+ .container{
3
+ width: 90%;
4
+ min-width: 1200px;
5
+ }
6
+ </style>
7
+ <table id="slow-requests" class="table" style="width: 100%">
2
8
  <thead>
3
9
  <tr>
4
10
  <th>请求时间</th>
5
- <th>action</th>
6
- <th>总耗时</th>
7
- <th>db_time</th>
8
- <th>view time</th>
9
- <th>外部http time</th>
10
- <th>内存增幅(M)</th>
11
- <th>host</th>
12
- <th>remote_addr</th>
11
+ <th>ActionName</th>
12
+ <th>TotalTime</th>
13
+ <th>DB</th>
14
+ <th>View</th>
15
+ <th>HTTP</th>
16
+ <th>Memory(Mb)</th>
17
+ <th>server</th>
18
+ <th>ip</th>
13
19
  </tr>
14
20
  </thead>
15
21
  </table>
@@ -10,8 +10,13 @@ module SimpleApm
10
10
  SimpleApm::NetHttp.install
11
11
 
12
12
  ActiveSupport::Notifications.subscribe('process_action.action_controller') do |name, started, finished, unique_id, payload|
13
+ remote_addr = (payload[:headers]['HTTP_X_REAL_IP'] rescue nil)
14
+ if remote_addr.blank? || remote_addr=='127.0.0.1'
15
+ remote_addr = (payload[:headers]['REMOTE_ADDR'] rescue nil)
16
+ end
13
17
  ProcessingThread.add_event(
14
18
  name: name,
19
+ remote_addr: remote_addr,
15
20
  request_id: Thread.current['action_dispatch.request_id'],
16
21
  started: started, finished: finished,
17
22
  payload: payload.reject{|k,v|k.to_s=='headers'},
@@ -1,3 +1,3 @@
1
1
  module SimpleApm
2
- VERSION = '1.0.9'
2
+ VERSION = '1.0.10'
3
3
  end
@@ -22,6 +22,7 @@ module SimpleApm
22
22
  finished = event[:finished]
23
23
  started = event[:started]
24
24
  request_id = event[:request_id]
25
+ remote_addr = event[:remote_addr]
25
26
  net_http_during = event[:net_http_during]
26
27
  begin
27
28
  need_skip = payload[:controller] == 'SimpleApm::ApmController'
@@ -46,7 +47,7 @@ module SimpleApm
46
47
  controller: payload[:controller],
47
48
  action: payload[:action],
48
49
  host: Socket.gethostname,
49
- remote_addr: (payload[:headers]['HTTP_X_REAL_IP'] rescue nil),
50
+ remote_addr: remote_addr,
50
51
  method: payload[:method],
51
52
  completed_memory: completed_memory,
52
53
  memory_during: memory_during,
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.9
4
+ version: 1.0.10
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-23 00:00:00.000000000 Z
11
+ date: 2018-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails