Apdex and Request Metrics
Apdex
Apdex is an open standard for reporting and comparing the performance of applications, specifically around meeting users' expectations. By way of Rack middleware, Metrician records metrics related to probably customer satisfaction.
Configuration
Metrician has 4 configuration options that can be set in your copy of metrician.yaml
to report Apdex metrics. Apdex reporting is enabled by default.
:request_timing: :enabled: true :request: :enabled: true :apdex: :enabled: true :satisfied_threshold: 2.5
satisfied_threshold
is a decimal number of seconds threshold before your users will go from “satisfied” to “tolerated”. At 4x that threshold (10s in this example), the user is considered to go from “tolerated” to “frustrated”. Increase or decrease this number if your application users are more or less tolerant of longer request times.
Metrics
app.web.request |
average request time |
---|---|
app.web.apdex.satisfied |
avg request time for requests finished under the satisfied threshold |
app.web.apdex.tolerated |
avg request time for requests finished between the satisfied and tolerated (4x) thresholds |
app.web.apdex.frustrated |
avg request time for request over the tolerated threshold |
Apdex Query Language Expression
You can add an Apdex graph to your dashboard with the following expression:
series_clamp(0, 1, (gauge_count(app.web.apdex.satisfied) + (gauge_count(app.web.apdex.tolerated)/2))/gauge_count(app.web.request)) as apdex
Find out what percentage of your users were frustrated by adding a graph to your dashboard with the following expression:
gauge_count(app.web.apdex.frustrated) / gauge_count(app.web.request) * 100
Request Metrics
Requests have a large number of separate components that make up the whole. Using our rack middleware (1, 2) your application can report metrics measuring web server queue time, idle time, total request time, exception counts, response sizes, and middleware times. For request time, error reporting, and response sizes, you can also record metrics per controller (in Rails).
Configuration
The following are the default settings that control request metric reporting. By default, request and error reporting are enabled.
:request_timing: :enabled: true :request: :enabled: true :error: :enabled: true :idle: :enabled: false :response_size: :enabled: false :middleware: :enabled: false :queue_time: :enabled: false :route_tracking: :enabled: false
Metrics
app.web.request |
average request time (ms) |
---|---|
app.web.error |
count of 5xx errors |
app.web.idle |
avg time (ms) web process waits between requests |
app.web.response_size |
avg size (bytes) of response |
app.web.middleware |
avg time (ms) spent processing middleware |
app.web.queue_time |
avg time (ms) requests spend at web server (pre-application) |
If the request_tracking
option is enabled, then you can also report request, error, and response size metrics per controller, action, and HTTP verb. For example, if you have a PostsController
with an index
action that is HTTP GET
'ed, you might see the following metrics:
app.web.request.posts_controller.index.get
app.web.error.posts_controller.index.get
(when an exception is raised)app.web.response_size.posts_controller.index.get
Request Metrics Query Language Expressions
Add the following expression to a graph to see your request rate for a given resolution (RPM, RPH, etc.):
gauge_count(app.web.request)
Add the following expression to a graph to see your web error rate percentage:
app.web.error / gauge_count(app.web.request) * 100