Class: Datadog::DI::CorrelationSampler::TraceBudgetLedger::Entry Private

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/di/correlation_sampler/trace_budget_ledger/entry.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Retained budget and the weak reference to its trace.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trace_ref:, budget:) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes the entry.

Parameters:

  • trace_ref (WeakRef) —

    weak reference to the entry's trace

  • budget (TraceBudget) —

    the trace's budget



26
27
28
29
# File 'lib/datadog/di/correlation_sampler/trace_budget_ledger/entry.rb', line 26

def initialize(trace_ref:, budget:)
  @trace_ref = trace_ref
  @budget = budget
end

Instance Attribute Details

#budget ⇒ TraceBudget (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The trace's budget.

Returns:



19
20
21
# File 'lib/datadog/di/correlation_sampler/trace_budget_ledger/entry.rb', line 19

def budget
  @budget
end

#trace_ref ⇒ WeakRef (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Weak reference to the trace the budget belongs to.

Returns:

  • (WeakRef)


14
15
16
# File 'lib/datadog/di/correlation_sampler/trace_budget_ledger/entry.rb', line 14

def trace_ref
  @trace_ref
end