Class: Staccato::Timing
Overview
Timing Hit type field definitions
Constant Summary collapse
- FIELDS =
Timing field definitions
{ category: 'utc', variable: 'utv', label: 'utl', time: 'utt', # more specific timings page_load_time: 'plt', dns_time: 'dns', page_download_time: 'pdt', redirect_response_time: 'rrt', tcp_connect_time: 'tcp', server_response_time: 'srt' }
Constants included from Hit
Hit::BOOLEAN_FIELDS, Hit::GLOBAL_OPTIONS
Instance Method Summary collapse
-
#track!(&block) ⇒ Object
tracks the timing hit type.
-
#type ⇒ Object
timing hit type.
Methods included from Hit
#add_custom_dimension, #add_custom_metric, #custom_dimensions, #custom_metrics, #fields, included, #initialize, #params, #session_control
Instance Method Details
#track!(&block) ⇒ Object
tracks the timing hit type
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/staccato/timing.rb', line 30 def track!(&block) if block_given? start_at = Time.now block.call end_at = Time.now self..time = (end_at - start_at).to_i*1000 end super end |
#type ⇒ Object
timing hit type
24 25 26 |
# File 'lib/staccato/timing.rb', line 24 def type :timing end |