Class: OpenTracing::Instrumentation::Thrift::TracedProcessorOperationNameBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/opentracing/instrumentation/thrift/traced_processor_operation_name_builder.rb

Overview

Thrift processor trace operation name builder

Constant Summary collapse

DEFAULT_OPERATION_NAME_TEMPALTE =
'thrift_processor(%<name>s)'

Instance Method Summary collapse

Constructor Details

#initialize(operation_name_template: DEFAULT_OPERATION_NAME_TEMPALTE) ⇒ TracedProcessorOperationNameBuilder

Returns a new instance of TracedProcessorOperationNameBuilder.

Parameters:

  • operation_name_tempalte (String)


12
13
14
15
16
# File 'lib/opentracing/instrumentation/thrift/traced_processor_operation_name_builder.rb', line 12

def initialize(
  operation_name_template: DEFAULT_OPERATION_NAME_TEMPALTE
)
  @operation_name_template = operation_name_template
end

Instance Method Details

#build(name, type, seq_id) ⇒ String

Returns operation name.

Parameters:

  • name (String)

    method name

  • type (Integer)

    type of message

  • seq_id (Integer)

    numberr of message

Returns:

  • (String)

    operation name



22
23
24
25
# File 'lib/opentracing/instrumentation/thrift/traced_processor_operation_name_builder.rb', line 22

def build(name, type, seq_id)
  format_args = build_format_args(name, type, seq_id)
  format(operation_name_template, **format_args)
end