Module: D13n::Metric::Stream::StreamTracerHelpers::Namer
- Defined in:
- lib/d13n/metric/stream/stream_tracer_helpers.rb
Instance Method Summary collapse
- #metric_name(type) ⇒ Object
- #prefix ⇒ Object
- #stream_apdex_tags(metric_data) ⇒ Object
- #stream_basic_tags(metric_data) ⇒ Object
- #stream_duration_tags(metric_data) ⇒ Object
- #stream_error_tags(metric_data, error) ⇒ Object
- #stream_exclusive_tags(metric_data) ⇒ Object
- #stream_http_request_content_length_tags(metric_data) ⇒ Object
- #stream_http_response_code_tags(metric_data) ⇒ Object
- #stream_http_response_content_length_tags(metric_data) ⇒ Object
- #stream_http_response_content_type_tags(metric_data) ⇒ Object
- #stream_request_tags(metric_data) ⇒ Object
Instance Method Details
#metric_name(type) ⇒ Object
9 10 11 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 9 def metric_name(type) "#{prefix}.#{type}" end |
#prefix ⇒ Object
5 6 7 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 5 def prefix "app.http.i" end |
#stream_apdex_tags(metric_data) ⇒ Object
74 75 76 77 78 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 74 def (metric_data) = (metric_data) << "apdex_zone:#{metric_data[:apdex_perf_zone]}" end |
#stream_basic_tags(metric_data) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 13 def (metric_data) = [] << "idc:#{D13n.idc_name}" << "env:#{D13n.idc_env}" << "app:#{D13n.app_name}" << "name:#{metric_data[:name]}" << "uuid:#{metric_data[:uuid]}" << "stream_id:#{metric_data[:referring_stream_id] || metric_data[:uuid]}" << "type:#{metric_data[:referring_stream_id].nil? ? 'stream' : 'span'}" end |
#stream_duration_tags(metric_data) ⇒ Object
25 26 27 28 29 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 25 def (metric_data) = (metric_data) << "time:duration" end |
#stream_error_tags(metric_data, error) ⇒ Object
68 69 70 71 72 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 68 def (metric_data, error) = (metric_data) << "error:#{error.is_a?(Class) ? error.name : error.class.name}" end |
#stream_exclusive_tags(metric_data) ⇒ Object
31 32 33 34 35 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 31 def (metric_data) = (metric_data) << "time:exclusive" end |
#stream_http_request_content_length_tags(metric_data) ⇒ Object
56 57 58 59 60 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 56 def (metric_data) = (metric_data) << "request:length" end |
#stream_http_response_code_tags(metric_data) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 42 def (metric_data) = (metric_data) << "response:code" << "code:#{metric_data[:http_response_code]}" end |
#stream_http_response_content_length_tags(metric_data) ⇒ Object
62 63 64 65 66 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 62 def (metric_data) = (metric_data) << "response:length" end |
#stream_http_response_content_type_tags(metric_data) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 49 def (metric_data) = (metric_data) << "response:type" << "type:#{metric_data[:http_response_content_type]}" end |
#stream_request_tags(metric_data) ⇒ Object
37 38 39 40 |
# File 'lib/d13n/metric/stream/stream_tracer_helpers.rb', line 37 def (metric_data) = (metric_data) end |