Class: Datadog::Tracing::Flush::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/tracing/flush.rb

Overview

This class is abstract.

Consumes and returns a TraceSegment to be flushed, from the provided TraceSegment.

Only finished spans are consumed. Any spans consumed are removed from trace_op as a side effect. Unfinished spans are unaffected.

Direct Known Subclasses

Finished, Partial

Instance Method Summary collapse

Instance Method Details

#consume!(trace_op) ⇒ TraceSegment

Consumes and returns a TraceSegment to be flushed, from the provided TraceSegment.

Only finished spans are consumed. Any spans consumed are removed from trace_op as a side effect. Unfinished spans are unaffected.

Parameters:

Returns:

  • (TraceSegment)

    trace to be flushed, or nil if the trace is not finished



24
25
26
27
28
# File 'lib/datadog/tracing/flush.rb', line 24

def consume!(trace_op)
  return unless flush?(trace_op)

  get_trace(trace_op)
end

#flush?(trace_op) ⇒ Boolean

This method is abstract.

Should we consume spans from the trace_op?

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/datadog/tracing/flush.rb', line 32

def flush?(trace_op)
  raise NotImplementedError
end