- Metric Sources
- Using Instrumental
- Where to Start
Method Timing Metrics
Unlike the rest of the Metrician suite, method timing is a utility you need to configure per-use inside your codebase. It allows you to report timing and rate metrics about methods inside your application.
Metrician requires 1 configuration option be enabled in your copy of
metrician.yaml, and at least one instance of configuration inside your application itself. Method timing is disabled by default.
:method_timer: :enabled: false
In your code, you need to add a call to
add_metrician_method_timer as in the following example.
class AddUser < Service def call # do some work in an instance method end add_metrician_method_timer :call def self.calculate(user) # do some work in a class method end add_metrician_method_timer :calculate end
|app.timer.add_user.call||average time taken to execute the method
|app.timer.add_user.self.calculate_something||average time taken to execute the class method
How often does my
AddUser#call method get executed?