Module: Metrician::Middleware
- Defined in:
- lib/metrician/middleware.rb,
lib/metrician/middleware/request_timing.rb,
lib/metrician/middleware/application_timing.rb
Defined Under Namespace
Classes: ApplicationTiming, RequestTiming
Constant Summary
collapse
- ENV_REQUEST_TOTAL_TIME =
"METRICIAN_REQUEST_TOTAL_TIME".freeze
- ENV_QUEUE_START_KEYS =
["X-Request-Start".freeze,
"X-Queue-Start".freeze,
"X-REQUEST-START".freeze,
"X_REQUEST_START".freeze,
"HTTP_X_QUEUE_START".freeze]
- ENV_CONTROLLER_PATH =
"action_controller.instance".freeze
- ENV_REQUEST_PATH =
"REQUEST_PATH".freeze
"Content-Length".freeze
- ASSET_CONTROLLER_ROUTE =
"assets".freeze
- UNKNOWN_CONTROLLER_ROUTE =
"unknown_endpoint".freeze
- UNKNOWN_ACTION =
"unknown_action".freeze
- ASSET_PATH_MATCHER =
%r|\A/{0,2}/assets|.freeze
- APDEX_SATISFIED_METRIC =
"web.apdex.satisfied".freeze
- APDEX_TOLERATED_METRIC =
"web.apdex.tolerated".freeze
- APDEX_FRUSTRATED_METRIC =
"web.apdex.frustrated".freeze
Class Method Summary
collapse
Class Method Details
.apdex? ⇒ Boolean
60
61
62
|
# File 'lib/metrician/middleware.rb', line 60
def self.apdex?
@apdex ||= configuration[:apdex][:enabled]
end
|
.configuration ⇒ Object
20
21
22
|
# File 'lib/metrician/middleware.rb', line 20
def self.configuration
@configuration ||= Metrician.configuration[:request_timing]
end
|
.enabled? ⇒ Boolean
24
25
26
|
# File 'lib/metrician/middleware.rb', line 24
def self.enabled?
@enabled ||= configuration[:enabled]
end
|
.error? ⇒ Boolean
36
37
38
|
# File 'lib/metrician/middleware.rb', line 36
def self.error?
@error ||= configuration[:error][:enabled]
end
|
.idle? ⇒ Boolean
40
41
42
|
# File 'lib/metrician/middleware.rb', line 40
def self.idle?
@idle ||= configuration[:idle][:enabled]
end
|
.middleware? ⇒ Boolean
48
49
50
|
# File 'lib/metrician/middleware.rb', line 48
def self.middleware?
@middleware ||= configuration[:middleware][:enabled]
end
|
.queue_time? ⇒ Boolean
52
53
54
|
# File 'lib/metrician/middleware.rb', line 52
def self.queue_time?
@queue_time ||= configuration[:queue_time][:enabled]
end
|
.request? ⇒ Boolean
32
33
34
|
# File 'lib/metrician/middleware.rb', line 32
def self.request?
@request ||= configuration[:request][:enabled]
end
|
.request_timing_required? ⇒ Boolean
28
29
30
|
# File 'lib/metrician/middleware.rb', line 28
def self.request_timing_required?
request? || apdex?
end
|
.reset ⇒ Object
64
65
66
67
68
69
70
|
# File 'lib/metrician/middleware.rb', line 64
def self.reset
%w[@configuration @enabled @request @error @idle @response_size @middleware @queue_time @route_tracking @apdex].each do |memo_ivar|
if instance_variable_defined?(memo_ivar)
remove_instance_variable(memo_ivar)
end
end
end
|
.response_size? ⇒ Boolean
44
45
46
|
# File 'lib/metrician/middleware.rb', line 44
def self.response_size?
@response_size ||= configuration[:response_size][:enabled]
end
|
.route_tracking? ⇒ Boolean
56
57
58
|
# File 'lib/metrician/middleware.rb', line 56
def self.route_tracking?
@route_tracking ||= configuration[:route_tracking][:enabled]
end
|