Class: Instana::Trace::Samplers::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/instana/samplers/result.rb

Constant Summary collapse

EMPTY_HASH =
{}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(decision:, tracestate:, attributes: nil) ⇒ Result

Returns a new instance of Result.



10
11
12
13
14
# File 'lib/instana/samplers/result.rb', line 10

def initialize(decision:, tracestate:, attributes: nil)
  @decision = decision
  @attributes = attributes.freeze || EMPTY_HASH
  @tracestate = tracestate
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



8
9
10
# File 'lib/instana/samplers/result.rb', line 8

def attributes
  @attributes
end

#tracestateObject (readonly)

Returns the value of attribute tracestate.



8
9
10
# File 'lib/instana/samplers/result.rb', line 8

def tracestate
  @tracestate
end

Instance Method Details

#recording?Boolean

Returns true if this span should record events, attributes, status, etc.

returns TRUE always

Returns:

  • (Boolean)


26
27
28
# File 'lib/instana/samplers/result.rb', line 26

def recording?
  true
end

#sampled?Boolean

Returns true if this span should be sampled.

Returns:

  • (Boolean)

    FALSE always



19
20
21
# File 'lib/instana/samplers/result.rb', line 19

def sampled?
  false
end