Class: AiUsage::CostReconciler::Report

Inherits:
Data
  • Object
show all
Defined in:
app/services/ai_usage/cost_reconciler.rb

Overview

Full reconciliation result for a window.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ending_atObject (readonly)

Returns the value of attribute ending_at

Returns:

  • (Object)

    the current value of ending_at



26
27
28
# File 'app/services/ai_usage/cost_reconciler.rb', line 26

def ending_at
  @ending_at
end

#real_total_usdObject (readonly)

Returns the value of attribute real_total_usd

Returns:

  • (Object)

    the current value of real_total_usd



26
27
28
# File 'app/services/ai_usage/cost_reconciler.rb', line 26

def real_total_usd
  @real_total_usd
end

#rowsObject (readonly)

Returns the value of attribute rows

Returns:

  • (Object)

    the current value of rows



26
27
28
# File 'app/services/ai_usage/cost_reconciler.rb', line 26

def rows
  @rows
end

#starting_atObject (readonly)

Returns the value of attribute starting_at

Returns:

  • (Object)

    the current value of starting_at



26
27
28
# File 'app/services/ai_usage/cost_reconciler.rb', line 26

def starting_at
  @starting_at
end

#tracked_total_usdObject (readonly)

Returns the value of attribute tracked_total_usd

Returns:

  • (Object)

    the current value of tracked_total_usd



26
27
28
# File 'app/services/ai_usage/cost_reconciler.rb', line 26

def tracked_total_usd
  @tracked_total_usd
end

Instance Method Details

#coverage_pctFloat

Returns overall tracked as a percentage of real.

Returns:

  • (Float)

    overall tracked as a percentage of real



28
29
30
# File 'app/services/ai_usage/cost_reconciler.rb', line 28

def coverage_pct
  real_total_usd.zero? ? 100.0 : (tracked_total_usd / real_total_usd * 100).round(1)
end