Class: LlmCostTracker::Reconciliation::DiffResult

Inherits:
Data
  • Object
show all
Defined in:
lib/llm_cost_tracker/reconciliation/diff_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#currencyObject (readonly)

Returns the value of attribute currency

Returns:

  • (Object)

    the current value of currency



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def currency
  @currency
end

#delta_amountObject (readonly)

Returns the value of attribute delta_amount

Returns:

  • (Object)

    the current value of delta_amount



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def delta_amount
  @delta_amount
end

#delta_percentObject (readonly)

Returns the value of attribute delta_percent

Returns:

  • (Object)

    the current value of delta_percent



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def delta_percent
  @delta_percent
end

#local_totalObject (readonly)

Returns the value of attribute local_total

Returns:

  • (Object)

    the current value of local_total



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def local_total
  @local_total
end

#local_total_sourceObject (readonly)

Returns the value of attribute local_total_source

Returns:

  • (Object)

    the current value of local_total_source



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def local_total_source
  @local_total_source
end

#non_cost_rowsObject (readonly)

Returns the value of attribute non_cost_rows

Returns:

  • (Object)

    the current value of non_cost_rows



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def non_cost_rows
  @non_cost_rows
end

#non_cost_rows_totalObject (readonly)

Returns the value of attribute non_cost_rows_total

Returns:

  • (Object)

    the current value of non_cost_rows_total



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def non_cost_rows_total
  @non_cost_rows_total
end

#period_endObject (readonly)

Returns the value of attribute period_end

Returns:

  • (Object)

    the current value of period_end



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def period_end
  @period_end
end

#period_startObject (readonly)

Returns the value of attribute period_start

Returns:

  • (Object)

    the current value of period_start



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def period_start
  @period_start
end

#providerObject (readonly)

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def provider
  @provider
end

#provider_totalObject (readonly)

Returns the value of attribute provider_total

Returns:

  • (Object)

    the current value of provider_total



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def provider_total
  @provider_total
end

#scopeObject (readonly)

Returns the value of attribute scope

Returns:

  • (Object)

    the current value of scope



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def scope
  @scope
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def source
  @source
end

#unmatched_local_callsObject (readonly)

Returns the value of attribute unmatched_local_calls

Returns:

  • (Object)

    the current value of unmatched_local_calls



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def unmatched_local_calls
  @unmatched_local_calls
end

#unmatched_local_calls_totalObject (readonly)

Returns the value of attribute unmatched_local_calls_total

Returns:

  • (Object)

    the current value of unmatched_local_calls_total



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def unmatched_local_calls_total
  @unmatched_local_calls_total
end

#unmatched_provider_rowsObject (readonly)

Returns the value of attribute unmatched_provider_rows

Returns:

  • (Object)

    the current value of unmatched_provider_rows



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def unmatched_provider_rows
  @unmatched_provider_rows
end

#unmatched_provider_rows_totalObject (readonly)

Returns the value of attribute unmatched_provider_rows_total

Returns:

  • (Object)

    the current value of unmatched_provider_rows_total



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 5

def unmatched_provider_rows_total
  @unmatched_provider_rows_total
end

Instance Method Details

#aligned?(threshold_percent: Reconciliation::DEFAULT_THRESHOLD_PERCENT) ⇒ Boolean

Returns:

  • (Boolean)


36
37
38
39
40
41
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 36

def aligned?(threshold_percent: Reconciliation::DEFAULT_THRESHOLD_PERCENT)
  return true if provider_total.zero? && local_total.zero?
  return false if delta_percent.nil?

  delta_percent.abs <= threshold_percent
end

#non_cost_rows_truncated?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 32

def non_cost_rows_truncated?
  non_cost_rows.size < non_cost_rows_total
end

#unmatched_local_calls_truncated?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 28

def unmatched_local_calls_truncated?
  unmatched_local_calls.size < unmatched_local_calls_total
end

#unmatched_provider_rows_truncated?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/llm_cost_tracker/reconciliation/diff_result.rb', line 24

def unmatched_provider_rows_truncated?
  unmatched_provider_rows.size < unmatched_provider_rows_total
end