meter 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/meter/rails/controller_instrumentation.rb +4 -7
- data/lib/meter/rails/middleware.rb +4 -4
- data/lib/meter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b6db8e65d10c31f0ee741e06764621bb8da09c17212a1952e82539d13001b12
|
4
|
+
data.tar.gz: 9a5e43559e1147a2f881b4d52a0a94853479e1585fa0dde228f8f769912e6b91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d7e63220cb4a41ebc70461f50054ee82590440f44970f11ca2ab4e758c584929ae5ec9d1a8347a94cc9c037b9a035b74247331bc2c21f284077dc261ba401c2
|
7
|
+
data.tar.gz: b52c0c3facd07ab34664ee4955932bc1f50cbca56a231e970263d0d82d52cd7a3e5ef809b7f5e4f88404623c714967f688d72ae2d6a7ec0ffaf414d5308f7e0d
|
@@ -4,24 +4,21 @@ ActiveSupport::Notifications.subscribe /process_action.action_controller/ do |*a
|
|
4
4
|
controller = payload[:controller]
|
5
5
|
action = payload[:action]
|
6
6
|
format = payload[:format] || 'all'
|
7
|
-
format =
|
7
|
+
format = 'all' if format == '*/*'
|
8
8
|
http_status = payload[:status]
|
9
9
|
|
10
10
|
total_duration = event.duration.to_i
|
11
11
|
|
12
|
-
|
12
|
+
meter_data = {
|
13
13
|
controller: controller,
|
14
14
|
format: format,
|
15
15
|
method: payload[:method],
|
16
|
-
http_status: http_status
|
17
|
-
}
|
18
|
-
|
19
|
-
meter_data = {
|
16
|
+
http_status: http_status,
|
20
17
|
action: action,
|
21
18
|
path: payload[:path],
|
22
19
|
params: payload[:params].to_query,
|
23
20
|
duration: total_duration
|
24
21
|
}
|
25
22
|
|
26
|
-
Meter.log 'requests',
|
23
|
+
Meter.log 'requests', data: meter_data
|
27
24
|
end
|
@@ -27,9 +27,9 @@ module Meter
|
|
27
27
|
|
28
28
|
def store_user_agent_data(request)
|
29
29
|
user_agent = UserAgent.parse(request.user_agent)
|
30
|
-
Meter::MDC.
|
31
|
-
Meter::MDC.
|
32
|
-
Meter::MDC.
|
30
|
+
Meter::MDC.data['user_agent_name'] = user_agent.browser
|
31
|
+
Meter::MDC.data['user_agent_platform'] = user_agent.platform
|
32
|
+
Meter::MDC.data['user_agent_bot'] = user_agent.bot?
|
33
33
|
Meter::MDC.data['user_agent_version'] = "#{user_agent.browser}_#{user_agent.version}"
|
34
34
|
|
35
35
|
Meter::MDC.data['user_agent'] = user_agent.to_s
|
@@ -37,7 +37,7 @@ module Meter
|
|
37
37
|
|
38
38
|
def store_geoip_data(request)
|
39
39
|
lookup = Locality::IP.new request.ip
|
40
|
-
Meter::MDC.
|
40
|
+
Meter::MDC.data['geoip_country'] = lookup.country_name if lookup.country_name
|
41
41
|
Meter::MDC.data['geoip_city'] = lookup.city_name if lookup.city_name
|
42
42
|
Meter::MDC.data['geoip_coords'] = "#{lookup.latitude},#{lookup.longitude}" if lookup.latitude && lookup.longitude
|
43
43
|
end
|
data/lib/meter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bukowskis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: useragent
|