Class: OpenTracing::Instrumentation::Thrift::TracedProtocolOperationNameBuilder
- Inherits:
-
Object
- Object
- OpenTracing::Instrumentation::Thrift::TracedProtocolOperationNameBuilder
- Defined in:
- lib/opentracing/instrumentation/thrift/traced_protocol_operation_name_builder.rb
Overview
Build operation name for TracedProtocol
Constant Summary collapse
- DEFAULT_OPERATION_NAME_PATTERN =
'thrift(direction=%<direction>s, name=%<name>s, type=%<type>s)'
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#build_operation_name(direction, name, type) ⇒ String
Formated operation name.
-
#initialize(operation_name_pattern: DEFAULT_OPERATION_NAME_PATTERN) ⇒ TracedProtocolOperationNameBuilder
constructor
A new instance of TracedProtocolOperationNameBuilder.
Constructor Details
#initialize(operation_name_pattern: DEFAULT_OPERATION_NAME_PATTERN) ⇒ TracedProtocolOperationNameBuilder
Returns a new instance of TracedProtocolOperationNameBuilder.
14 15 16 17 18 |
# File 'lib/opentracing/instrumentation/thrift/traced_protocol_operation_name_builder.rb', line 14 def initialize( operation_name_pattern: DEFAULT_OPERATION_NAME_PATTERN ) @operation_name_pattern = operation_name_pattern end |
Instance Method Details
#==(other) ⇒ Object
29 30 31 |
# File 'lib/opentracing/instrumentation/thrift/traced_protocol_operation_name_builder.rb', line 29 def ==(other) operation_name_pattern == other.operation_name_pattern end |
#build_operation_name(direction, name, type) ⇒ String
Returns formated operation name.
24 25 26 27 |
# File 'lib/opentracing/instrumentation/thrift/traced_protocol_operation_name_builder.rb', line 24 def build_operation_name(direction, name, type) format_args = build_format_args(direction, name, type) format(operation_name_pattern, **format_args) end |